Skip to content

Commit 0d40723

Browse files
committed
Revert "MB-39946: Don't record the system event size for collections"
This reverts commit 2e86e27. Commit added to aid investigation of MB-39946, not needed anymore. Change-Id: Id58c303d72b17f0a7971b2f7bcc95db4988991de Reviewed-on: http://review.couchbase.org/c/kv_engine/+/140360 Tested-by: Build Bot <[email protected]> Reviewed-by: Trond Norbye <[email protected]>
1 parent 9a2b33b commit 0d40723

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

engines/ep/src/collections/flush.cc

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,10 @@ void Flush::StatisticsUpdate::insert(bool isSystem,
6565
incrementItemCount();
6666
} // else inserting a tombstone - no item increment
6767

68-
// MB-39946: for now don't record the system event size to catch this bug
69-
// against any old collection (i.e any empty collection should now be 0
70-
// disk)
71-
if (!isSystem) {
72-
updateDiskSize(diskSizeDelta);
73-
}
68+
updateDiskSize(diskSizeDelta);
7469
}
7570

76-
void Flush::StatisticsUpdate::update(bool isSystem, ssize_t diskSizeDelta) {
77-
// MB-39946: for now don't record the system event size to catch this bug
78-
// against any old collection (i.e any empty collection should now be 0
79-
// disk)
80-
if (isSystem) {
81-
return;
82-
}
71+
void Flush::StatisticsUpdate::update(ssize_t diskSizeDelta) {
8372
updateDiskSize(diskSizeDelta);
8473
}
8574

@@ -355,7 +344,7 @@ void Flush::updateStats(const DocKey& key,
355344
} else if (!oldIsDelete && isDelete) {
356345
stats.remove(isSystemEvent, size - oldSize);
357346
} else {
358-
stats.update(isSystemEvent, size - oldSize);
347+
stats.update(size - oldSize);
359348
}
360349
}
361350
}

engines/ep/src/collections/flush.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,11 @@ class Flush {
291291

292292
/**
293293
* Process an update into the collection
294-
* @param isSystem true if updating a system event
295294
* @param diskSizeDelta size in bytes difference. Should be
296295
* representative of the difference between existing and new
297296
* documents, but does not need to be exact.
298297
*/
299-
void update(bool isSystem, ssize_t diskSizeDelta);
298+
void update(ssize_t diskSizeDelta);
300299

301300
/**
302301
* Process a remove from the collection (store of a delete)

engines/ep/tests/module_tests/collections/evp_store_collections_dcp_test.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,14 +2893,13 @@ void CollectionsDcpPersistentOnly::resurrectionStatsTest(
28932893

28942894
auto stats = vb->getManifest().lock(target.getId()).getPersistedStats();
28952895

2896-
// MB-39946: systemeventSize currently set to 0
28972896
// Note 57 manually verified from dbdump and is the system-event usage
28982897
// Note 14 manually verified from dbdump and is the item usage
2899-
size_t systemeventSize = 0;
2898+
size_t systemeventSize = 57;
29002899
size_t itemSize = 14;
29012900
if (isMagma()) {
29022901
// magma doesn't account the same bits and bytes
2903-
systemeventSize = 0;
2902+
systemeventSize = 56;
29042903
itemSize = 4;
29052904
}
29062905
EXPECT_EQ(1, stats.itemCount);

engines/ep/tests/module_tests/collections/evp_store_collections_eraser_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ TEST_P(CollectionsEraserTest, basic) {
111111
vb->lockCollections().getStatsForFlush(CollectionEntry::dairy, 1);
112112
if (persistent()) {
113113
EXPECT_EQ(0, stats.itemCount);
114-
EXPECT_EQ(0, stats.diskSize); // MB-39946: 0 size for system event
114+
EXPECT_NE(0, stats.diskSize);
115115
} else {
116116
EXPECT_EQ(2, stats.itemCount);
117117
EXPECT_EQ(0, stats.diskSize);
@@ -1304,11 +1304,11 @@ void CollectionsEraserPersistentOnly::testEmptyCollections(
13041304
kvs.getCollectionStats(*fileHandle, CollectionEntry::dairy);
13051305
EXPECT_EQ(0, stats.itemCount);
13061306
EXPECT_EQ(vb->getHighSeqno() - 1, stats.highSeqno);
1307-
EXPECT_EQ(0, stats.diskSize); // MB-39946: SystemEvent size not recorded
1307+
EXPECT_NE(0, stats.diskSize);
13081308
stats = kvs.getCollectionStats(*fileHandle, CollectionEntry::fruit);
13091309
EXPECT_EQ(0, stats.itemCount);
13101310
EXPECT_EQ(vb->getHighSeqno(), stats.highSeqno);
1311-
EXPECT_EQ(0, stats.diskSize); // MB-39946: SystemEvent size not recorded
1311+
EXPECT_NE(0, stats.diskSize);
13121312
} else {
13131313
auto handle = vb->lockCollections();
13141314
EXPECT_EQ(vb->getHighSeqno() - 1,

0 commit comments

Comments
 (0)