SERVER-120962 resharding_change_stream_internal_ops.js: enable reshardBlockingWrites change stream event assertions (#51978)
GitOrigin-RevId: 04794662d17a7f6877ca8c4afd3e944177e9abd3
This commit is contained in:
parent
bd6f99d62e
commit
3f42b4a9e3
@ -704,4 +704,6 @@ last-lts:
|
||||
ticket: SERVER-121533
|
||||
- test_file: jstests/core/timeseries/query/timeseries_lookup_index_use.js
|
||||
ticket: SERVER-95352
|
||||
- test_file: jstests/sharding/resharding_change_stream_internal_ops.js
|
||||
ticket: SERVER-120962
|
||||
suites: null
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
//
|
||||
// ]
|
||||
import {DiscoverTopology} from "jstests/libs/discover_topology.js";
|
||||
import {getCurrentFCV} from "jstests/libs/feature_compatibility_version.js";
|
||||
import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/query/change_stream_util.js";
|
||||
import {ReshardingTest} from "jstests/sharding/libs/resharding_test_fixture.js";
|
||||
|
||||
@ -47,22 +46,20 @@ const topology = DiscoverTopology.findConnectedNodes(mongos);
|
||||
const donor0 = new Mongo(topology.shards[donorShardNames[0]].primary);
|
||||
const cstDonor0 = new ChangeStreamTest(donor0.getDB(kDbName));
|
||||
let changeStreamsCursorDonor0 = cstDonor0.startWatchingChanges({
|
||||
pipeline: [{$changeStream: {showMigrationEvents: true}}],
|
||||
pipeline: [{$changeStream: {showMigrationEvents: true, showSystemEvents: true}}],
|
||||
collection: collName,
|
||||
});
|
||||
|
||||
const donor1 = new Mongo(topology.shards[donorShardNames[1]].primary);
|
||||
const cstDonor1 = new ChangeStreamTest(donor1.getDB(kDbName));
|
||||
let changeStreamsCursorDonor1 = cstDonor1.startWatchingChanges({
|
||||
pipeline: [{$changeStream: {showMigrationEvents: true}}],
|
||||
pipeline: [{$changeStream: {showMigrationEvents: true, showSystemEvents: true}}],
|
||||
collection: collName,
|
||||
});
|
||||
|
||||
const recipient0 = new Mongo(topology.shards[recipientShardNames[0]].primary);
|
||||
const cstRecipient0 = new ChangeStreamTest(recipient0.getDB(kDbName));
|
||||
|
||||
const fcv = getCurrentFCV(mongos);
|
||||
|
||||
let reshardingUUID;
|
||||
let changeStreamsCursorRecipient0;
|
||||
|
||||
@ -109,35 +106,32 @@ reshardingTest.withReshardingInBackground(
|
||||
false /* skipFirstBatch */,
|
||||
);
|
||||
assertChangeStreamEventEq(reshardBeginDonor1Event[0], expectedReshardBeginEvent);
|
||||
|
||||
// TODO (SERVER-120962): Investigate why these checks are failing.
|
||||
// TODO (SERVER-94478): Remove FCV check.
|
||||
// if (fcv == latestFCV) {
|
||||
// // Check for reshardBlockingWrites event on both donors.
|
||||
// const expectedReshardBlockingWritesEvent = {
|
||||
// reshardingUUID: reshardingUUID,
|
||||
// operationType: "reshardBlockingWrites",
|
||||
// ns: {db: kDbName, coll: collName},
|
||||
// };
|
||||
//
|
||||
// const reshardBlockingWritesDonor0Event = cstDonor0.getNextChanges(
|
||||
// changeStreamsCursorDonor0,
|
||||
// 1,
|
||||
// false /* skipFirstBatch */,
|
||||
// );
|
||||
//
|
||||
// assertChangeStreamEventEq(reshardBlockingWritesDonor0Event[0], expectedReshardBlockingWritesEvent);
|
||||
//
|
||||
// const reshardBlockingWritesDonor1Event = cstDonor1.getNextChanges(
|
||||
// changeStreamsCursorDonor1,
|
||||
// 1,
|
||||
// false /* skipFirstBatch */,
|
||||
// );
|
||||
//
|
||||
// assertChangeStreamEventEq(reshardBlockingWritesDonor1Event[0], expectedReshardBlockingWritesEvent);
|
||||
// }
|
||||
},
|
||||
{
|
||||
postCheckConsistencyFn: () => {
|
||||
// Check for reshardBlockingWrites event on both donors.
|
||||
const expectedReshardBlockingWritesEvent = {
|
||||
reshardingUUID: reshardingUUID,
|
||||
operationType: "reshardBlockingWrites",
|
||||
ns: {db: kDbName, coll: collName},
|
||||
};
|
||||
|
||||
const reshardBlockingWritesDonor0Event = cstDonor0.getNextChanges(
|
||||
changeStreamsCursorDonor0,
|
||||
1,
|
||||
false /* skipFirstBatch */,
|
||||
);
|
||||
|
||||
assertChangeStreamEventEq(reshardBlockingWritesDonor0Event[0], expectedReshardBlockingWritesEvent);
|
||||
|
||||
const reshardBlockingWritesDonor1Event = cstDonor1.getNextChanges(
|
||||
changeStreamsCursorDonor1,
|
||||
1,
|
||||
false /* skipFirstBatch */,
|
||||
);
|
||||
|
||||
assertChangeStreamEventEq(reshardBlockingWritesDonor1Event[0], expectedReshardBlockingWritesEvent);
|
||||
},
|
||||
postDecisionPersistedFn: () => {
|
||||
// Check for reshardDoneCatchUp event on the recipient.
|
||||
const expectedReshardDoneCatchUpEvent = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user