Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-54516: Generate a ModifyCollection SystemEvent
When processing a Manifest against VB::Manifest detect if the history setting changes. When a change in history occurs update the collection entry with the new value and generate a ModifyCollection system event. Once the VB::Manifest write lock is dropped, the VB::Manifest will return the new history value for all subsequent mutations (which are ordered after the ModifyCollection event). This will in a follow up change allow the replica to correctly process incoming mutations against the correct history setting. With this commit a ModifyCollection SystemEvent uses a single key per collection. The first modification is an insert, with all subsequent modifications generating updates. However if the CDC feature is enabled, the complete history (for the retention period) would be available to a DCP client, which could be useful if a DCP client enables change_streams and flatbuffer_system_events - they could infer the exact seqno ranges that have history enabled/disabled. In the seqno-index a life of a collection may now become 1: CreateCollection(name=c1, history=false) <- deduplication occurs 5: Mutation(c1, k1) 7: Mutation(c1, k2) 8: ModifyCollection(name=c1, history=true) <- all versions preserved 5: Mutation(c1, k1) 7: Mutation(c1, k1) Due to the non-unique key used for ModifyCollection, backfilling the vbucket history does not allow the reader to infer anything about the collections "history" configuration unless the bucket is configured to retain all versions. This commit only supports the ActiveReplicaManifest from vbucket_manifest_test.cc - the new SystemEvent does not yet transfer via DCP and cannot yet be flushed. Change-Id: I4a1ab90bcb56ca07647840183302724df3c63d7a Reviewed-on: https://review.couchbase.org/c/kv_engine/+/183249 Well-Formed: Restriction Checker Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Paolo Cocchi <paolo.cocchi@couchbase.com>
- Loading branch information
1 parent
47a8114
commit 0eb2b8f
Showing
13 changed files
with
272 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.