Skip to content

PHPLIB-1485: Drop support for MongoDB 3.6 #1360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ include:
- filename: .evergreen/config/generated/test/local-4.4.yml
- filename: .evergreen/config/generated/test/local-4.2.yml
- filename: .evergreen/config/generated/test/local-4.0.yml
- filename: .evergreen/config/generated/test/local-3.6.yml
- filename: .evergreen/config/generated/test/load-balanced-latest.yml
- filename: .evergreen/config/generated/test/load-balanced-rapid.yml
- filename: .evergreen/config/generated/test/load-balanced-8.0.yml
Expand Down
1 change: 0 additions & 1 deletion .evergreen/config/generate-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
'4.4',
'4.2',
'4.0',
'3.6',
];

// Server versions
Expand Down
8 changes: 4 additions & 4 deletions .evergreen/config/generated/test-variant/full-php-7.4.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .evergreen/config/generated/test-variant/full-php-8.0.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions .evergreen/config/generated/test-variant/full-php-8.1.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions .evergreen/config/generated/test-variant/full-php-8.2.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions .evergreen/config/generated/test-variant/full-php-8.3.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions .evergreen/config/generated/test/local-3.6.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .evergreen/config/templates/test-variant/legacy-php-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ buildvariants:
name: "build-php-%phpVersion%"
tasks:
# Remember to add new major versions here as they are released
- ".standalone .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.8.0"
- ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.8.0"
- ".sharded .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.8.0"
- ".loadbalanced .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.8.0"
- ".standalone .local !.csfle !.4.0 !.4.2 !.4.4 !.8.0"
- ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.8.0"
- ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.8.0"
- ".loadbalanced .local !.csfle !.4.0 !.4.2 !.4.4 !.8.0"
- "test_serverless_task_group"
- "test_serverless_proxy_task_group"
- "test-atlas-data-lake"
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config/templates/test-variant/lowest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ buildvariants:
- variant: "build-debian92"
name: "build-php-%phpVersion%-lowest"
tasks:
- ".replicaset .local .3.6 !.csfle"
- ".replicaset .local .4.0 !.csfle"
16 changes: 8 additions & 8 deletions .evergreen/config/templates/test-variant/modern-php-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ buildvariants:
- variant: "build-debian12"
name: "build-php-%phpVersion%"
tasks:
- ".standalone .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".sharded .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".loadbalanced .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".standalone .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".loadbalanced .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- "test_serverless_task_group"
- "test_serverless_proxy_task_group"
- "test-atlas-data-lake"
Expand All @@ -35,10 +35,10 @@ buildvariants:
name: "build-php-%phpVersion%"
tasks:
# Remember to add new major versions here as they are released
- ".standalone .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest"
- ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest"
- ".sharded .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest"
- ".loadbalanced .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest"
- ".standalone .local !.csfle !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest"
- ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest"
- ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest"
- ".loadbalanced .local !.csfle !.4.0 !.4.2 !.4.4 !.7.0 !.8.0 !.rapid !.latest"

# Test versions < 5.0
- name: test-debian92-php-%phpVersion%-local
Expand Down
16 changes: 8 additions & 8 deletions .evergreen/config/templates/test-variant/phpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ buildvariants:
- variant: "build-debian12"
name: "build-php-%phpVersion%-next-stable"
tasks:
- ".standalone .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".sharded .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".loadbalanced .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".standalone .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".loadbalanced .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- "test_serverless_task_group"
- "test_serverless_proxy_task_group"
- "test-atlas-data-lake"
Expand All @@ -32,10 +32,10 @@ buildvariants:
- variant: "build-debian12"
name: "build-php-%phpVersion%-next-minor"
tasks:
- ".standalone .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".sharded .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".loadbalanced .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".standalone .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".replicaset .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".sharded .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- ".loadbalanced .local !.csfle !.4.0 !.4.2 !.4.4 !.5.0 !.6.0"
- "test_serverless_task_group"
- "test_serverless_proxy_task_group"
- "test-atlas-data-lake"
7 changes: 0 additions & 7 deletions src/Operation/Explain.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use function current;
use function is_array;
use function is_string;
use function MongoDB\server_supports_feature;

/**
* Operation for the explain command.
Expand All @@ -42,8 +41,6 @@ class Explain implements Executable
public const VERBOSITY_EXEC_STATS = 'executionStats';
public const VERBOSITY_QUERY = 'queryPlanner';

private const WIRE_VERSION_FOR_AGGREGATE = 7;

private string $databaseName;

private Explainable $explainable;
Expand Down Expand Up @@ -106,10 +103,6 @@ public function __construct(string $databaseName, Explainable $explainable, arra
*/
public function execute(Server $server)
{
if ($this->explainable instanceof Aggregate && ! server_supports_feature($server, self::WIRE_VERSION_FOR_AGGREGATE)) {
throw UnsupportedException::explainNotSupported();
}

$cursor = $server->executeCommand($this->databaseName, $this->createCommand(), $this->createOptions());

if (isset($this->options['typeMap'])) {
Expand Down
7 changes: 0 additions & 7 deletions src/Operation/Watch.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
use function MongoDB\Driver\Monitoring\removeSubscriber;
use function MongoDB\is_document;
use function MongoDB\select_server;
use function MongoDB\server_supports_feature;

/**
* Operation for creating a change stream with the aggregate command.
Expand All @@ -69,8 +68,6 @@ class Watch implements Executable, /* @internal */ CommandSubscriber
public const FULL_DOCUMENT_BEFORE_CHANGE_WHEN_AVAILABLE = 'whenAvailable';
public const FULL_DOCUMENT_BEFORE_CHANGE_REQUIRED = 'required';

private const WIRE_VERSION_FOR_START_AT_OPERATION_TIME = 7;

private Aggregate $aggregate;

private array $aggregateOptions;
Expand Down Expand Up @@ -470,10 +467,6 @@ private function shouldCaptureOperationTime(Server $server): bool
return false;
}

if (! server_supports_feature($server, self::WIRE_VERSION_FOR_START_AT_OPERATION_TIME)) {
return false;
}

return true;
}
}
12 changes: 0 additions & 12 deletions tests/Operation/WatchFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use function assert;
use function bin2hex;
use function microtime;
use function MongoDB\server_supports_feature;
use function sprintf;

/**
Expand All @@ -46,8 +45,6 @@ class WatchFunctionalTest extends FunctionalTestCase
public const INTERRUPTED = 11601;
public const NOT_PRIMARY = 10107;

private static int $wireVersionForStartAtOperationTime = 7;

private array $defaultOptions = ['maxAwaitTimeMS' => 500];

public function setUp(): void
Expand Down Expand Up @@ -340,10 +337,6 @@ private function assertResumeAfter($expectedResumeToken, stdClass $command): voi
*/
public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime(): void
{
if (! $this->isStartAtOperationTimeSupported()) {
$this->markTestSkipped('startAtOperationTime is not supported');
}

$this->skipIfServerVersion('>=', '4.0.7', 'postBatchResumeToken takes precedence over startAtOperationTime');

$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], $this->defaultOptions);
Expand Down Expand Up @@ -1653,11 +1646,6 @@ private function insertDocument($document): void
$this->assertEquals(1, $writeResult->getInsertedCount());
}

private function isStartAtOperationTimeSupported()
{
return server_supports_feature($this->getPrimaryServer(), self::$wireVersionForStartAtOperationTime);
}

private function advanceCursorUntilValid(Iterator $iterator, $limitOnShardedClusters = 10): void
{
if (! $this->isShardedCluster()) {
Expand Down