Skip to content

Commit 1c6bbe7

Browse files
committed
address comments
1 parent eb10bcb commit 1c6bbe7

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

fdbserver/storageserver.actor.cpp

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,9 @@ struct StorageServerDisk {
599599
Version newStorageVersion,
600600
int64_t& bytesLeft,
601601
UnlimitedCommitBytes unlimitedCommitBytes,
602-
int64_t& clearRangesLeft);
602+
int64_t& clearRangesLeft,
603+
const UID& ssId,
604+
bool verbose = false);
603605
void makeVersionDurable(Version version);
604606
void makeAccumulativeChecksumDurable(const AccumulativeChecksumState& acsState);
605607
void clearAccumulativeChecksumState(const AccumulativeChecksumState& acsState);
@@ -12988,12 +12990,22 @@ ACTOR Future<Void> updateStorage(StorageServer* data) {
1298812990
}
1298912991
}
1299012992

12993+
// When unlimitedCommitBytes is set to true, clearRangesLeft will be ignored.
12994+
// Make sure unlimitedCommitBytes is set to True only when storage engine is sharded rocksdb.
12995+
ASSERT(data->shardAware || unlimitedCommitBytes == UnlimitedCommitBytes::False);
12996+
1299112997
// Write mutations to storage until we reach the desiredVersion or have written too much (bytesleft)
1299212998
// or until we reach clearRanges limit, in case of rocksdb.
1299312999
state double beforeStorageUpdates = now();
1299413000
loop {
12995-
state bool done = data->storage.makeVersionMutationsDurable(
12996-
newOldestVersion, desiredVersion, bytesLeft, unlimitedCommitBytes, clearRangesLeft);
13001+
state bool done = data->storage.makeVersionMutationsDurable(newOldestVersion,
13002+
desiredVersion,
13003+
bytesLeft,
13004+
unlimitedCommitBytes,
13005+
clearRangesLeft,
13006+
data->thisServerID,
13007+
data->storage.getKeyValueStoreType() ==
13008+
KeyValueStoreType::SSD_ROCKSDB_V1);
1299713009
if (data->tenantMap.getLatestVersion() < newOldestVersion) {
1299813010
data->tenantMap.createNewVersion(newOldestVersion);
1299913011
}
@@ -13581,10 +13593,21 @@ bool StorageServerDisk::makeVersionMutationsDurable(Version& prevStorageVersion,
1358113593
Version newStorageVersion,
1358213594
int64_t& bytesLeft,
1358313595
UnlimitedCommitBytes unlimitedCommitBytes,
13584-
int64_t& clearRangesLeft) {
13596+
int64_t& clearRangesLeft,
13597+
const UID& ssId,
13598+
bool verbose) {
1358513599
if (!unlimitedCommitBytes && (bytesLeft <= 0 || clearRangesLeft <= 0))
1358613600
return true;
1358713601

13602+
if (clearRangesLeft <= 0 && verbose) {
13603+
TraceEvent(SevInfo, "MakeVersionMutationsDurableClearRangesLeftZero", ssId)
13604+
.suppressFor(5.0)
13605+
.detail("PrevStorageVersion", prevStorageVersion)
13606+
.detail("NewStorageVersion", newStorageVersion)
13607+
.detail("BytesLeft", bytesLeft)
13608+
.detail("ClearRangesLeft", clearRangesLeft)
13609+
.detail("UnlimitedCommitBytes", unlimitedCommitBytes);
13610+
}
1358813611
// Apply mutations from the mutationLog
1358913612
auto u = data->getMutationLog().upper_bound(prevStorageVersion);
1359013613
if (u != data->getMutationLog().end() && u->first <= newStorageVersion) {

0 commit comments

Comments
 (0)