@@ -2002,18 +2002,18 @@ static enum test_result test_dcp_producer_stream_req_partial(EngineIface* h) {
20022002 get_int_stat (h, " vb_0:open_checkpoint_id" , " checkpoint" );
20032003 checkeq (1 , initial_ckpt_id, " Expected to start at checkpoint ID 1" );
20042004
2005- // Create two 'full' checkpoints by storing 2 x 'chk_max_items' + 1
2005+ // Create two 'full' checkpoints by storing exactly 2 x 'chk_max_items'
20062006 // into the VBucket.
20072007 const auto max_ckpt_items = get_int_stat (h, " ep_chk_max_items" );
20082008
2009- write_items (h, max_ckpt_items + 1 );
2009+ write_items (h, max_ckpt_items);
20102010 wait_for_flusher_to_settle (h);
20112011 wait_for_stat_to_be (h, " ep_items_rm_from_checkpoints" , max_ckpt_items);
20122012 checkeq (initial_ckpt_id + 1 ,
20132013 get_int_stat (h, " vb_0:open_checkpoint_id" , " checkpoint" ),
20142014 " Expected #checkpoints to increase by 1 after storing items" );
20152015
2016- write_items (h, max_ckpt_items + 1 , max_ckpt_items);
2016+ write_items (h, max_ckpt_items, max_ckpt_items);
20172017 wait_for_flusher_to_settle (h);
20182018 wait_for_stat_to_be (h, " ep_items_rm_from_checkpoints" , max_ckpt_items * 2 );
20192019 checkeq (initial_ckpt_id + 2 ,
@@ -2054,11 +2054,11 @@ static enum test_result test_dcp_producer_stream_req_partial(EngineIface* h) {
20542054 ctx.vb_uuid = get_ull_stat (h, " vb_0:0:id" , " failovers" );
20552055 ctx.seqno = {105 , 209 };
20562056 ctx.snapshot = {105 , 105 };
2057- ctx.exp_mutations = 97 ; // 105 to 200
2057+ ctx.exp_mutations = 95 ; // 105 to 200
20582058 ctx.exp_deletions = 100 ; // 201 to 300
20592059
20602060 if (isPersistentBucket (h)) {
2061- ctx.exp_markers = 3 ;
2061+ ctx.exp_markers = 2 ;
20622062 } else {
20632063 // the ephemeral stream request won't be broken into two snapshots of
20642064 // backfill from disk vs the checkpoint in memory
@@ -2257,41 +2257,29 @@ static test_result testDcpProducerExpiredItemBackfill(
22572257}
22582258
22592259static enum test_result test_dcp_producer_stream_req_backfill (EngineIface* h) {
2260- const auto max_ckpt_items = get_int_stat (h, " ep_chk_max_items" );
2261-
2262- const int batch_items = max_ckpt_items;
2263- const int num_items = batch_items * 2 ;
2260+ const int num_items = 400 , batch_items = 200 ;
22642261 for (int start_seqno = 0 ; start_seqno < num_items;
22652262 start_seqno += batch_items) {
2266- if (start_seqno == batch_items) {
2267- // stop persistence after the first batch is on disk
2263+ if (200 == start_seqno) {
22682264 wait_for_flusher_to_settle (h);
2269- wait_for_stat_to_be (h,
2270- " vb_0:persistence_seqno" ,
2271- batch_items,
2272- " vbucket-details" );
2265+ wait_for_stat_to_be (h, " ep_items_rm_from_checkpoints" , 200 );
22732266 stop_persistence (h);
22742267 }
22752268 write_items (h, batch_items, start_seqno);
22762269 }
22772270
2278- // Wait for the first checkpoint to be removed.
2279- // The second checkpoint is the open checkpoint (and for a persistent
2280- // bucket, contains unpersisted items) and won't be removed
2281- wait_for_stat_to_be_gte (h, " ep_items_rm_from_checkpoints" , batch_items);
2282-
22832271 auto * cookie = testHarness->create_cookie (h);
22842272
22852273 DcpStreamCtx ctx;
22862274 ctx.vb_uuid = get_ull_stat (h, " vb_0:0:id" , " failovers" );
2287- ctx.seqno = {0 , uint64_t (batch_items) };
2275+ ctx.seqno = {0 , 200 };
22882276 // The idea here is that at backfill we get the full Disk/SeqList snapshot.
22892277 // Persistence has been stopped at seqno 200, while Ephemeral stores all
22902278 // seqnos in the SeqList.
22912279 if (isEphemeralBucket (h)) {
2292- ctx.exp_mutations = num_items ;
2280+ ctx.exp_mutations = 400 ;
22932281 } else {
2294- ctx.exp_mutations = batch_items ;
2282+ ctx.exp_mutations = 200 ;
22952283 }
22962284 ctx.exp_markers = 1 ;
22972285
@@ -2360,11 +2348,6 @@ static enum test_result test_dcp_producer_disk_backfill_buffer_limits(
23602348 wait_for_flusher_to_settle (h);
23612349 verify_curr_items (h, num_items, " Wrong amount of items" );
23622350
2363- testHarness->time_travel (65 );
2364- // store one more item after advancing time to close the previous
2365- // checkpoint, allowing it to be removed
2366- wait_for_persisted_value (h, " padding-key" , " some value" );
2367-
23682351 /* Wait for the checkpoint to be removed so that upon DCP connection
23692352 backfill is scheduled */
23702353 wait_for_stat_to_be (h, " ep_items_rm_from_checkpoints" , num_items);
@@ -2374,7 +2357,7 @@ static enum test_result test_dcp_producer_disk_backfill_buffer_limits(
23742357 DcpStreamCtx ctx;
23752358 ctx.vb_uuid = get_ull_stat (h, " vb_0:0:id" , " failovers" );
23762359 ctx.seqno = {0 , num_items};
2377- ctx.exp_mutations = num_items + 1 ;
2360+ ctx.exp_mutations = 3 ;
23782361 ctx.exp_markers = 1 ;
23792362
23802363 TestDcpConsumer tdc (" unittest" , cookie, h);
@@ -2908,12 +2891,7 @@ static enum test_result test_dcp_producer_stream_cursor_movement(
29082891 cdc.dcpConsumer ->producers .last_byseqno ,
29092892 exp_items);
29102893
2911- testHarness->time_travel (65 );
2912- // store one more item to close the previous checkpoint, allowing it
2913- // to be removed
2914- wait_for_persisted_value (h, " padding-key" , " some value" );
2915-
2916- /* Wait for new open checkpoint to be added */
2894+ /* Wait for new open (empty) checkpoint to be added */
29172895 wait_for_stat_to_be (
29182896 h, " vb_0:open_checkpoint_id" , curr_chkpt_id + 1 , " checkpoint" );
29192897
@@ -3774,11 +3752,6 @@ static enum test_result test_failover_scenario_two_with_dcp(EngineIface* h) {
37743752 // Front-end operations (sets)
37753753 write_items (h, 2 , 1 , " key_" );
37763754
3777- testHarness->time_travel (65 );
3778- // store one more item to close the previous checkpoint, allowing it
3779- // to be removed
3780- wait_for_persisted_value (h, " padding-key" , " some value" );
3781-
37823755 // Wait for a new open checkpoint
37833756 wait_for_stat_to_be (
37843757 h, " vb_0:open_checkpoint_id" , openCheckpointId + 1 , " checkpoint" );
@@ -6156,19 +6129,14 @@ static enum test_result test_dcp_last_items_purged(EngineIface* h) {
61566129 get_int_stat (h, " vb_0:purge_seqno" , " vbucket-seqno" ),
61576130 " purge_seqno didn't match expected value" );
61586131
6159- testHarness->time_travel (65 );
6160- // store one more item to close the previous checkpoint, allowing it
6161- // to be removed
6162- wait_for_persisted_value (h, " padding-key" , " some value" );
6163-
61646132 wait_for_stat_to_be (h, " vb_0:open_checkpoint_id" , 2 , " checkpoint" );
61656133 wait_for_stat_to_be (h, " vb_0:num_checkpoints" , 1 , " checkpoint" );
61666134
61676135 /* Create a DCP stream */
61686136 DcpStreamCtx ctx;
61696137 ctx.vb_uuid = get_ull_stat (h, " vb_0:0:id" , " failovers" );
61706138 ctx.seqno = {0 , get_ull_stat (h, " vb_0:high_seqno" , " vbucket-seqno" )};
6171- ctx.exp_mutations = 2 ;
6139+ ctx.exp_mutations = 1 ;
61726140 ctx.exp_deletions = 1 ;
61736141 ctx.exp_markers = 1 ;
61746142 ctx.skip_estimate_check = true ;
@@ -6241,11 +6209,6 @@ static enum test_result test_dcp_rollback_after_purge(EngineIface* h) {
62416209 get_int_stat (h, " vb_0:purge_seqno" , " vbucket-seqno" ),
62426210 " purge_seqno didn't match expected value" );
62436211
6244- testHarness->time_travel (65 );
6245- // store one more item to close the previous checkpoint, allowing it
6246- // to be removed
6247- wait_for_persisted_value (h, " padding-key" , " some value" );
6248-
62496212 wait_for_stat_to_be (h, " vb_0:open_checkpoint_id" , 2 , " checkpoint" );
62506213 wait_for_stat_to_be (h, " vb_0:num_checkpoints" , 1 , " checkpoint" );
62516214
0 commit comments