Skip to content

Commit 4eab7f9

Browse files
jameseh96daverigby
authored andcommitted
Handle seqno ack in MockDcpMessageProducers
ep_testsuite_dcp unconditionally enables sync replication in add_stream_for_consumer, but returns ENGINE_ENOTSUP on receipt of a seqno ack. We should handle seqno acks like other ops, allowing tests to assert that a seqno ack occurred. Change-Id: I7de77d38334b0c1e5534ef9643594ef091dd3025 Reviewed-on: http://review.couchbase.org/111874 Reviewed-by: Dave Rigby <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent 499907b commit 4eab7f9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

engines/ep/tests/mock/mock_dcp.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,15 @@ ENGINE_ERROR_CODE MockDcpMessageProducers::prepare(
408408
nru);
409409
}
410410

411+
ENGINE_ERROR_CODE MockDcpMessageProducers::seqno_acknowledged(
412+
uint32_t opaque, Vbid vbucket, uint64_t prepared_seqno) {
413+
last_op = cb::mcbp::ClientOpcode::DcpSeqnoAcknowledged;
414+
last_opaque = opaque;
415+
last_vbucket = vbucket;
416+
last_prepared_seqno = prepared_seqno;
417+
return ENGINE_SUCCESS;
418+
}
419+
411420
ENGINE_ERROR_CODE MockDcpMessageProducers::get_error_map(uint32_t opaque,
412421
uint16_t version) {
413422
clear_dcp_data();

engines/ep/tests/mock/mock_dcp.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ class MockDcpMessageProducers : public dcp_message_producers {
139139

140140
ENGINE_ERROR_CODE seqno_acknowledged(uint32_t opaque,
141141
Vbid vbucket,
142-
uint64_t prepared_seqno) override {
143-
return ENGINE_ENOTSUP;
144-
}
142+
uint64_t prepared_seqno) override;
145143
ENGINE_ERROR_CODE commit(uint32_t opaque,
146144
Vbid vbucket,
147145
const DocKey& key,
@@ -190,6 +188,7 @@ class MockDcpMessageProducers : public dcp_message_producers {
190188
uint64_t last_collection_manifest_uid;
191189
cb::mcbp::DcpStreamId last_stream_id;
192190
std::string last_collection_filter;
191+
uint64_t last_prepared_seqno;
193192

194193
protected:
195194
/// Helper method for deletion / deletion_v2 / expiration

0 commit comments

Comments
 (0)