Skip to content

Commit 5686159

Browse files
committed
MB-29483: Disable DCP cursor dropping
Disable DCP cursor dropping: 1. DCP replication consumers no longer request cursor dropping. 2. DCP producers default cursorDropping to false, and ignore any requests to enable it. Change-Id: Ia9b5620d43c821eeaa32a7ec67df419a51acc089 Reviewed-on: http://review.couchbase.org/93534 Reviewed-by: Tim Bradgate <[email protected]> Reviewed-by: Jim Walker <[email protected]> Well-Formed: Build Bot <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent dfeff61 commit 5686159

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

src/dcp/consumer.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ DcpConsumer::DcpConsumer(EventuallyPersistentEngine &engine, const void *cookie,
123123
pendingSetPriority = true;
124124
pendingEnableExtMetaData = true;
125125
pendingEnableValueCompression = config.isDcpValueCompressionEnabled();
126-
pendingSupportCursorDropping = true;
126+
// MB-29369: Don't request cursor dropping.
127+
pendingSupportCursorDropping = false;
127128

128129
ExTask task = new Processor(&engine, this, 1);
129130
processorTaskId = ExecutorPool::get()->schedule(task, NONIO_TASK_IDX);

src/dcp/producer.cc

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,10 @@ DcpProducer::DcpProducer(EventuallyPersistentEngine &e, const void *cookie,
172172
enableExtMetaData = false;
173173
enableValueCompression = false;
174174

175-
// Cursor dropping is disabled for replication connections by default,
176-
// but will be enabled through a control message to support backward
177-
// compatibility. For all other type of DCP connections, cursor dropping
178-
// will be enabled by default.
179-
if (name.find("replication") < name.length()) {
180-
supportsCursorDropping = false;
181-
} else {
182-
supportsCursorDropping = true;
183-
}
175+
// MB-29369: Cursor dropping is currently disabled for all
176+
// connections due to race condition which can result in skipping
177+
// mutations.
178+
supportsCursorDropping = false;
184179

185180
backfillMgr.reset(new BackfillManager(&engine_));
186181

@@ -584,11 +579,8 @@ ENGINE_ERROR_CODE DcpProducer::control(uint32_t opaque, const void* key,
584579
}
585580
return ENGINE_SUCCESS;
586581
} else if (strncmp(param, "supports_cursor_dropping", nkey) == 0) {
587-
if (valueStr == "true") {
588-
supportsCursorDropping = true;
589-
} else {
590-
supportsCursorDropping = false;
591-
}
582+
// MB-29369: Cursor dropping currently disabled. Ignore requests
583+
// to enable.
592584
return ENGINE_SUCCESS;
593585
} else if (strncmp(param, "set_noop_interval", nkey) == 0) {
594586
if (parseUint32(valueStr.c_str(), &noopCtx.noopInterval)) {

tests/ep_testsuite_dcp.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,6 +2321,9 @@ static test_result test_dcp_agg_stats(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1) {
23212321

23222322
static test_result test_dcp_cursor_dropping(ENGINE_HANDLE *h,
23232323
ENGINE_HANDLE_V1 *h1) {
2324+
// MB-29369: Cursor dropping currently disabled
2325+
return SKIPPED;
2326+
23242327
/* Initially write a few items */
23252328
int num_items = 25;
23262329
const int cursor_dropping_mem_thres_perc = 90;
@@ -2407,6 +2410,9 @@ static test_result test_dcp_cursor_dropping(ENGINE_HANDLE *h,
24072410

24082411
static test_result test_dcp_cursor_dropping_backfill(ENGINE_HANDLE *h,
24092412
ENGINE_HANDLE_V1 *h1) {
2413+
// MB-29369: Cursor dropping currently disabled
2414+
return SKIPPED;
2415+
24102416
/* Initially write a few items */
24112417
int num_items = 50;
24122418
const int cursor_dropping_mem_thres_perc = 90;
@@ -2907,10 +2913,13 @@ static uint32_t add_stream_for_consumer(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1,
29072913
cb_assert(dcp_last_opaque != opaque);
29082914
}
29092915

2916+
// MB-29369: Cursor dropping currently disabled.
2917+
#if 0
29102918
dcp_step(h, h1, cookie);
29112919
cb_assert(dcp_last_op == PROTOCOL_BINARY_CMD_DCP_CONTROL);
29122920
cb_assert(dcp_last_key.compare("supports_cursor_dropping") == 0);
29132921
cb_assert(dcp_last_opaque != opaque);
2922+
#endif
29142923

29152924
checkeq(ENGINE_SUCCESS,
29162925
h1->dcp.add_stream(h, cookie, opaque, vbucket, flags),

0 commit comments

Comments
 (0)