@@ -491,7 +491,7 @@ TEST_P(VBucketDurabilityTest, Active_Commit_MultipleReplicas) {
491491 CheckpointManagerTestIntrospector::public_getCheckpointList (
492492 *ckptMgr);
493493
494- auto checkPending = [this , &key, &ckptList, preparedSeqno ]() -> void {
494+ auto checkPending = [this , &key, &ckptList]() -> void {
495495 EXPECT_EQ (nullptr , ht->findForRead (key).storedValue );
496496 const auto sv = ht->findForWrite (key).storedValue ;
497497 ASSERT_NE (nullptr , sv);
@@ -501,13 +501,11 @@ TEST_P(VBucketDurabilityTest, Active_Commit_MultipleReplicas) {
501501 for (const auto & qi : *ckptList.front ()) {
502502 if (!qi->isCheckPointMetaItem ()) {
503503 EXPECT_EQ (queue_op::pending_sync_write, qi->getOperation ());
504- EXPECT_EQ (preparedSeqno, qi->getBySeqno ());
505- EXPECT_EQ (" value" , qi->getValue ()->to_s ());
506504 }
507505 }
508506 };
509507
510- auto checkCommitted = [this , &key, &ckptList, preparedSeqno ]() -> void {
508+ auto checkCommitted = [this , &key, &ckptList]() -> void {
511509 const auto sv = ht->findForRead (key).storedValue ;
512510 ASSERT_NE (nullptr , sv);
513511 EXPECT_NE (nullptr , ht->findForWrite (key).storedValue );
@@ -517,9 +515,6 @@ TEST_P(VBucketDurabilityTest, Active_Commit_MultipleReplicas) {
517515 for (const auto & qi : *ckptList.front ()) {
518516 if (!qi->isCheckPointMetaItem ()) {
519517 EXPECT_EQ (queue_op::commit_sync_write, qi->getOperation ());
520- EXPECT_GT (qi->getBySeqno () /* commitSeqno*/ , preparedSeqno);
521- EXPECT_EQ (preparedSeqno, qi->getPrepareSeqno ());
522- EXPECT_EQ (" value" , qi->getValue ()->to_s ());
523518 }
524519 }
525520 };
@@ -684,8 +679,7 @@ TEST_P(VBucketDurabilityTest, NonPendingKeyAtAbort) {
684679 * 3) the abort_sync_write is not added to the DurabilityMonitor
685680 */
686681TEST_P (VBucketDurabilityTest, Active_AbortSyncWrite) {
687- const int64_t preparedSeqno = 1 ;
688- storeSyncWrites ({preparedSeqno});
682+ storeSyncWrites ({1 } /* seqno*/ );
689683 ASSERT_EQ (1 ,
690684 VBucketTestIntrospector::public_getActiveDM (*vbucket)
691685 .getNumTracked ());
@@ -701,9 +695,9 @@ TEST_P(VBucketDurabilityTest, Active_AbortSyncWrite) {
701695 // Visible at write
702696 auto storedItem = ht->findForWrite (key);
703697 ASSERT_TRUE (storedItem.storedValue );
698+ // item pending
704699 EXPECT_EQ (CommittedState::Pending,
705700 storedItem.storedValue ->getCommitted ());
706- EXPECT_EQ (preparedSeqno, storedItem.storedValue ->getBySeqno ());
707701 }
708702
709703 const auto & ckptList =
@@ -725,7 +719,6 @@ TEST_P(VBucketDurabilityTest, Active_AbortSyncWrite) {
725719 it++;
726720 ASSERT_EQ (1 , ckpt->getNumItems ());
727721 EXPECT_EQ (queue_op::pending_sync_write, (*it)->getOperation ());
728- EXPECT_EQ (preparedSeqno, (*it)->getBySeqno ());
729722 EXPECT_EQ (" value" , (*it)->getValue ()->to_s ());
730723
731724 // The Pending is tracked by the DurabilityMonitor
@@ -772,8 +765,6 @@ TEST_P(VBucketDurabilityTest, Active_AbortSyncWrite) {
772765 EXPECT_EQ (queue_op::abort_sync_write, (*it)->getOperation ());
773766 EXPECT_TRUE ((*it)->isDeleted ());
774767 EXPECT_FALSE ((*it)->getValue ());
775- EXPECT_GT ((*it)->getBySeqno (), preparedSeqno);
776- EXPECT_EQ (preparedSeqno, (*it)->getPrepareSeqno ());
777768
778769 // The Aborted item is not added for tracking.
779770 // Note: The Pending has not been removed as we are testing at VBucket
@@ -1035,9 +1026,8 @@ void VBucketDurabilityTest::testHTSyncDeleteCommit() {
10351026 auto * writeView = ht->findForWrite (key).storedValue ;
10361027 ASSERT_TRUE (writeView);
10371028 VBQueueItemCtx ctx;
1038- ctx.durability = DurabilityItemCtx{
1039- cb::durability::Requirements{cb::durability::Level::Majority, {}},
1040- cookie};
1029+ ctx.durability =
1030+ DurabilityItemCtx{{cb::durability::Level::Majority, {}}, cookie};
10411031 ASSERT_EQ (MutationStatus::WasDirty,
10421032 public_processSoftDelete (key, ctx).first );
10431033
@@ -1472,28 +1462,14 @@ void VBucketDurabilityTest::testCompleteSWInPassiveDM(vbucket_state_t state,
14721462 const auto & ckptList =
14731463 CheckpointManagerTestIntrospector::public_getCheckpointList (
14741464 *ckptMgr);
1475- // 1 checkpoint
14761465 ASSERT_EQ (1 , ckptList.size ());
1477- // empty-item
1478- const auto & ckpt = *ckptList.front ();
1479- auto it = ckpt.begin ();
1480- ASSERT_EQ (queue_op::empty, (*it)->getOperation ());
1481- // 1 metaitem (checkpoint-start)
1482- it++;
1483- ASSERT_EQ (1 , ckpt.getNumMetaItems ());
1484- EXPECT_EQ (queue_op::checkpoint_start, (*it)->getOperation ());
1485- // 3 non-metaitem are Committed or Aborted
1486- ASSERT_EQ (writes.size (), ckpt.getNumItems ());
1466+ EXPECT_EQ (writes.size (), ckptList.front ()->getNumItems ());
14871467 const auto expectedOp =
14881468 (res == Resolution::Commit ? queue_op::commit_sync_write
14891469 : queue_op::abort_sync_write);
1490- for (const auto & prepare : writes) {
1491- it++;
1492- EXPECT_EQ (expectedOp, (*it)->getOperation ());
1493- EXPECT_GT ((*it)->getBySeqno () /* commitSeqno*/ , prepare.seqno );
1494- EXPECT_EQ (prepare.seqno , (*it)->getPrepareSeqno ());
1495- if (expectedOp == queue_op::commit_sync_write) {
1496- EXPECT_EQ (" value" , (*it)->getValue ()->to_s ());
1470+ for (const auto & qi : *ckptList.front ()) {
1471+ if (!qi->isCheckPointMetaItem ()) {
1472+ EXPECT_EQ (expectedOp, qi->getOperation ());
14971473 }
14981474 }
14991475
0 commit comments