diff options
author | Benety Goh <benety@mongodb.com> | 2021-07-24 10:57:09 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-07-24 15:20:24 +0000 |
commit | 9ab435d6edf776af83466517efdbf5a6d043c9d8 (patch) | |
tree | 395b629d4b33f6f01da1349d68737f0264026fc4 /jstests | |
parent | d4aa8951600a04d6b4233fa56e52dfd9e85eafbd (diff) | |
download | mongo-9ab435d6edf776af83466517efdbf5a6d043c9d8.tar.gz |
SERVER-56171 remove downgrade tests for retryable writes on time-series collections
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/multiVersion/timeseries_retryable_write_downgrade.js | 61 | ||||
-rw-r--r-- | jstests/multiVersion/timeseries_retryable_write_downgrade_oplog_rollover.js | 69 |
2 files changed, 0 insertions, 130 deletions
diff --git a/jstests/multiVersion/timeseries_retryable_write_downgrade.js b/jstests/multiVersion/timeseries_retryable_write_downgrade.js deleted file mode 100644 index 458d73c2283..00000000000 --- a/jstests/multiVersion/timeseries_retryable_write_downgrade.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Tests that config.transactions entries referencing oplog entries for time-series inserts, which - * can't be parsed on versions older than 4.9 if they contain multiple statement ids, are removed on - * FCV downgrade. - * - * TODO (SERVER-56171): Remove this test once 5.0 is last-lts. - */ -(function() { -'use strict'; - -load('jstests/core/timeseries/libs/timeseries.js'); -load("jstests/multiVersion/libs/multi_rs.js"); - -const replTest = new ReplSetTest({nodes: 2}); -replTest.startSet(); -replTest.initiate(); - -const primary = replTest.getPrimary(); - -if (!TimeseriesTest.timeseriesCollectionsEnabled(primary)) { - jsTestLog('Skipping test because the time-series collection feature flag is disabled'); - replTest.stopSet(); - return; -} - -const testDB = primary.startSession({retryWrites: true}).getDatabase('test'); -const coll = testDB[jsTestName()]; - -const timeFieldName = 'time'; - -assert.commandWorked( - testDB.createCollection(coll.getName(), {timeseries: {timeField: timeFieldName}})); - -// Insert two documents together which go into the same time-series bucket, so that the oplog entry -// has multiple statement ids. -assert.commandWorked( - coll.insert([{_id: 0, [timeFieldName]: ISODate()}, {_id: 1, [timeFieldName]: ISODate()}], - {ordered: false})); - -const configTransactions = primary.getDB('config')['transactions']; -assert.eq(configTransactions.find().toArray().length, 1); - -assert(coll.drop()); -assert.commandWorked(primary.adminCommand({setFeatureCompatibilityVersion: lastLTSFCV})); - -// Downgrading the FCV removes the config.transactions entry referencing an oplog entry for a -// time-series insert. -assert.eq(configTransactions.find().toArray().length, 0); - -replTest.upgradeSet({binVersion: 'last-lts'}); -replTest.awaitNodesAgreeOnPrimary(); -if (replTest.getPrimary() !== primary) { - replTest.stepUp(replTest.getSecondary()); -} - -// Another insert using the same session can succeed since it doesn't need to parse the oplog entry -// with multiple statement ids, which isn't supported on versions older than 4.9. -assert.commandWorked(coll.insert({_id: 0})); - -replTest.stopSet(); -})();
\ No newline at end of file diff --git a/jstests/multiVersion/timeseries_retryable_write_downgrade_oplog_rollover.js b/jstests/multiVersion/timeseries_retryable_write_downgrade_oplog_rollover.js deleted file mode 100644 index ec34b1fa824..00000000000 --- a/jstests/multiVersion/timeseries_retryable_write_downgrade_oplog_rollover.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Tests that config.transactions entries referencing oplog entries that have fallen off the oplog - * are ignored when removing retryable time-series entries from config.transactions on FCV - * downgrade. - * - * TODO (SERVER-56171): Remove this test once 5.0 is last-lts. - */ -(function() { -'use strict'; - -load('jstests/core/timeseries/libs/timeseries.js'); -load("jstests/multiVersion/libs/multi_rs.js"); - -const replTest = new ReplSetTest({nodes: 2}); -replTest.startSet({oplogSize: 1}); // Use a 1MB oplog. -replTest.initiate(); - -const primary = replTest.getPrimary(); - -if (!TimeseriesTest.timeseriesCollectionsEnabled(primary)) { - jsTestLog('Skipping test because the time-series collection feature flag is disabled'); - replTest.stopSet(); - return; -} - -const testDB = primary.startSession({retryWrites: true}).getDatabase('test'); -const coll = testDB[jsTestName()]; - -const timeFieldName = 'time'; - -assert.commandWorked( - testDB.createCollection(coll.getName(), {timeseries: {timeField: timeFieldName}})); - -// Insert two documents together which go into the same time-series bucket, so that the oplog entry -// has multiple statement ids. -assert.commandWorked( - coll.insert([{_id: 0, [timeFieldName]: ISODate()}, {_id: 1, [timeFieldName]: ISODate()}], - {ordered: false})); - -// Wait for the oplog entry of the retryable time-series insert to fall off the oplog. -assert.soonNoExcept(() => { - assert.commandWorked(primary.getDB(testDB.getName())[coll.getName() + '_rollover'].insert( - {a: 'a'.repeat(1024 * 1024)})); - return primary.getDB('local') - .oplog.rs.find({op: 'i', ns: testDB.getName() + '.system.buckets.' + coll.getName()}) - .itcount() === 0; -}); - -const configTransactions = primary.getDB('config')['transactions']; -assert.eq(configTransactions.find().toArray().length, 1); - -assert(coll.drop()); -assert.commandWorked(primary.adminCommand({setFeatureCompatibilityVersion: lastLTSFCV})); - -// The oplog entry no longer exists, so the config.transactions entry is not removed. -assert.eq(configTransactions.find().toArray().length, 1); - -replTest.upgradeSet({binVersion: 'last-lts'}); -replTest.awaitNodesAgreeOnPrimary(); -if (replTest.getPrimary() !== primary) { - replTest.stepUp(replTest.getSecondary()); -} - -// Another insert using the same session can succeed since it doesn't need to parse the oplog entry -// with multiple statement ids, which isn't supported on versions older than 4.9. -assert.commandWorked(coll.insert({_id: 0})); - -replTest.stopSet(); -})(); |