Skip to content

Commit

Permalink
Implement LogMeta#toString to easily debug zookeeper log removal wa…
Browse files Browse the repository at this point in the history
…rnings (#1070)

**Motivation**

With the improvement introduced by #1040, we have been observing logs where CentralDogma attempts to delete logs that don't exist.

In order to 1) verify which nodes are being prematurely deleted and 2) to observe trends as to why this may occur, I propose that `LogMeta#toString` be implemented.
  • Loading branch information
jrhee17 authored Dec 5, 2024
1 parent 2506b7d commit 32f958e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/actions_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
java: [21]
include:
- java: 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import com.github.benmanes.caffeine.cache.Caffeine;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.escape.Escaper;
Expand Down Expand Up @@ -1203,6 +1204,16 @@ List<Long> blocks() {
public void appendBlock(long blockId) {
blocks.add(blockId);
}

@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("replicaId", replicaId)
.add("timestamp", timestamp)
.add("size", size)
.add("blocks", blocks)
.toString();
}
}

private long storeLog(ReplicationLog<?> log) {
Expand Down

0 comments on commit 32f958e

Please sign in to comment.