diff options
author | Cheahuychou Mao <mao.cheahuychou@gmail.com> | 2023-05-16 18:42:34 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-16 22:00:24 +0000 |
commit | 9354aa6ccf769929ed3e7bd09f0dd95f8ab3a2a2 (patch) | |
tree | 3e8918826719bbfd5315b01fefd6b7b951637f99 /src/mongo/db/s/session_catalog_migration_source_test.cpp | |
parent | f05053d2cb65b84eaed4db94c25e9fe4be82d78c (diff) | |
download | mongo-9354aa6ccf769929ed3e7bd09f0dd95f8ab3a2a2.tar.gz |
SERVER-76807 Avoid adding opTimes for non-retryable internal transactions to the session migration new opTime buffer
Diffstat (limited to 'src/mongo/db/s/session_catalog_migration_source_test.cpp')
-rw-r--r-- | src/mongo/db/s/session_catalog_migration_source_test.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/s/session_catalog_migration_source_test.cpp b/src/mongo/db/s/session_catalog_migration_source_test.cpp index 3cca3b085b8..fc489def1bb 100644 --- a/src/mongo/db/s/session_catalog_migration_source_test.cpp +++ b/src/mongo/db/s/session_catalog_migration_source_test.cpp @@ -996,8 +996,9 @@ TEST_F(SessionCatalogMigrationSourceTest, ASSERT_EQ(migrationSource.getSessionOplogEntriesSkippedSoFarLowerBound(), 0); } -TEST_F(SessionCatalogMigrationSourceTest, - DiscardOplogEntriesForNewCommittedInternalTransactionForNonRetryableWrite) { +DEATH_TEST_F(SessionCatalogMigrationSourceTest, + DiscardOplogEntriesForNewCommittedInternalTransactionForNonRetryableWrite, + "invariant") { SessionCatalogMigrationSource migrationSource(opCtx(), kNs, kChunkRange, kShardKey); migrationSource.init(opCtx(), kMigrationLsid); ASSERT_FALSE(migrationSource.fetchNextOplog(opCtx())); @@ -1021,6 +1022,10 @@ TEST_F(SessionCatalogMigrationSourceTest, ASSERT_TRUE(migrationSource.hasMoreOplog()); ASSERT_FALSE(migrationSource.fetchNextOplog(opCtx())); ASSERT_EQ(migrationSource.getSessionOplogEntriesToBeMigratedSoFar(), 0); + + // notifyNewWriteOpTime() uses dassert, so it will only invariant in debug mode. Deliberately + // crash here in non-debug mode to make the test work in both modes. + invariant(kDebugBuild); } TEST_F(SessionCatalogMigrationSourceTest, |