Skip to content

Commit

Permalink
MB-45408: Add PiTR variant to CollectionsSyncWriteParamTest
Browse files Browse the repository at this point in the history
Change-Id: I5c5dfdcb18b51d00fca580e7a4fdade9d92fe7c6
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/171935
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
  • Loading branch information
BenHuddleston authored and daverigby committed Mar 18, 2022
1 parent 5ffb37a commit 3909113
Showing 1 changed file with 22 additions and 3 deletions.
Expand Up @@ -168,11 +168,20 @@ TEST_P(CollectionsSyncWriteParamTest, drop_collection_with_pending_write) {
runCollectionsEraser(vbid);
}

EXPECT_EQ(1, adm.getNumTracked());
// The prepare is typically purged by compaction but with PiTR we have
// some extra criteria to hit that we don't in this test. As such, the
// prepare is still present on disk (and as such in the ADM and PDM as no
// callback is made) for PiTR tests.
auto expected = 1;
if (isPitrEnabled()) {
expected = 2;
}

EXPECT_EQ(expected, adm.getNumTracked());
EXPECT_EQ(4, adm.getHighPreparedSeqno());
EXPECT_EQ(0, adm.getHighCompletedSeqno());

EXPECT_EQ(1, pdm.getNumTracked());
EXPECT_EQ(expected, pdm.getNumTracked());
EXPECT_EQ(4, pdm.getHighPreparedSeqno());
EXPECT_EQ(0, pdm.getHighCompletedSeqno());
}
Expand Down Expand Up @@ -231,7 +240,12 @@ failover_entry_t CollectionsSyncWriteParamTest::
runCollectionsEraser(vbid);
}

EXPECT_EQ(1, adm.getNumTracked());
auto expected = 1;
if (isPitrEnabled()) {
expected = 2;
}

EXPECT_EQ(expected, adm.getNumTracked());
EXPECT_EQ(3, adm.getHighPreparedSeqno());
EXPECT_EQ(0, adm.getHighCompletedSeqno());

Expand Down Expand Up @@ -442,3 +456,8 @@ INSTANTIATE_TEST_SUITE_P(
CollectionsSyncWriteParamTest,
STParameterizedBucketTest::ephAndCouchstoreConfigValues(),
STParameterizedBucketTest::PrintToStringParamName);

INSTANTIATE_TEST_SUITE_P(CollectionsDcpEphemeralOrPersistentPitrEnabled,
CollectionsSyncWriteParamTest,
STParameterizedBucketTest::pitrEnabledConfigValues(),
STParameterizedBucketTest::PrintToStringParamName);

0 comments on commit 3909113

Please sign in to comment.