Skip to content

Commit 30fbadf

Browse files
committed
MB-41321: 4/4 Remove KVStore/Flush notification of dropped collection
Now that flush.cc has visibility of the all dropped collections there is no need for each KVStore to signal to Flush that a collection drop was committed. Change-Id: If4973680145da9b00bd6babec44badd98b32892e Reviewed-on: http://review.couchbase.org/c/kv_engine/+/137498 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent 89617e6 commit 30fbadf

File tree

4 files changed

+1
-18
lines changed

4 files changed

+1
-18
lines changed

engines/ep/src/collections/flush.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void Flush::notifyManifestOfAnyDroppedCollections() {
150150
}
151151

152152
void Flush::checkAndTriggerPurge(Vbid vbid, KVBucket& bucket) const {
153-
if (needsPurge) {
153+
if (!droppedCollections.empty()) {
154154
triggerPurge(vbid, bucket);
155155
}
156156
}

engines/ep/src/collections/flush.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ class Flush {
121121
*/
122122
static void triggerPurge(Vbid vbid, KVBucket& bucket);
123123

124-
void setNeedsPurge() {
125-
needsPurge = true;
126-
}
127-
128124
/**
129125
* Set that the KVStore needs to commit the data held in this object.
130126
*/
@@ -402,12 +398,6 @@ class Flush {
402398
*/
403399
Manifest& manifest;
404400

405-
/**
406-
* Set to true when any collection was dropped by the flusher and purging is
407-
* required to remove all items of the dropped collection(s)
408-
*/
409-
bool needsPurge = false;
410-
411401
/**
412402
* Set to true when any of the fields in this structure have data which
413403
* should be saved in the KVStore update/commit. The underlying KVStore

engines/ep/src/couch-kvstore/couch-kvstore.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3623,7 +3623,6 @@ void CouchKVStore::updateCollectionsMeta(
36233623

36243624
if (collectionsFlush.isDroppedCollectionsChanged()) {
36253625
updateDroppedCollections(db, collectionsFlush);
3626-
collectionsFlush.setNeedsPurge();
36273626
}
36283627

36293628
if (collectionsFlush.isScopesChanged()) {

engines/ep/src/magma-kvstore/magma-kvstore.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,18 +2158,12 @@ void MagmaKVStore::updateCollectionsMeta(
21582158
Collections::VB::Flush& collectionsFlush) {
21592159
updateManifestUid(localDbReqs, collectionsFlush);
21602160

2161-
// If the updateOpenCollections reads the dropped collections, it can pass
2162-
// them via this optional to updateDroppedCollections, thus we only read
2163-
// the dropped list once per update.
2164-
std::optional<std::vector<Collections::KVStore::DroppedCollection>> dropped;
2165-
21662161
if (collectionsFlush.isOpenCollectionsChanged()) {
21672162
updateOpenCollections(vbid, localDbReqs, collectionsFlush);
21682163
}
21692164

21702165
if (collectionsFlush.isDroppedCollectionsChanged()) {
21712166
updateDroppedCollections(vbid, localDbReqs, collectionsFlush);
2172-
collectionsFlush.setNeedsPurge();
21732167
}
21742168

21752169
if (collectionsFlush.isScopesChanged()) {

0 commit comments

Comments
 (0)