|
31 | 31 | import java.util.concurrent.atomic.AtomicInteger;
|
32 | 32 |
|
33 | 33 | import com.palantir.logsafe.SafeArg;
|
| 34 | +import com.palantir.logsafe.UnsafeArg; |
34 | 35 | import com.google.common.base.Predicate;
|
35 | 36 | import com.google.common.collect.HashMultimap;
|
36 | 37 | import com.google.common.collect.Iterables;
|
@@ -103,6 +104,7 @@ public static CommitLogReplayer construct(CommitLog commitLog)
|
103 | 104 | {
|
104 | 105 | // compute per-CF and global replay positions
|
105 | 106 | Map<UUID, ReplayPosition.ReplayFilter> cfPersisted = new HashMap<>();
|
| 107 | + Set<UUID> cfWithoutFilter = new HashSet<>(); |
106 | 108 | ReplayFilter replayFilter = ReplayFilter.create();
|
107 | 109 | ReplayPosition globalPosition = null;
|
108 | 110 | for (ColumnFamilyStore cfs : ColumnFamilyStore.all())
|
@@ -133,13 +135,18 @@ public static CommitLogReplayer construct(CommitLog commitLog)
|
133 | 135 | if (!filter.isEmpty())
|
134 | 136 | cfPersisted.put(cfs.metadata.cfId, filter);
|
135 | 137 | else
|
| 138 | + { |
136 | 139 | globalPosition = ReplayPosition.NONE; // if we have no ranges for this CF, we must replay everything and filter
|
| 140 | + cfWithoutFilter.add(cfs.metadata.cfId); |
| 141 | + } |
137 | 142 | }
|
138 | 143 | if (globalPosition == null)
|
139 | 144 | globalPosition = ReplayPosition.firstNotCovered(cfPersisted.values());
|
| 145 | + |
140 | 146 | logger.debug("Global replay position {} is from columnfamilies {}",
|
141 | 147 | SafeArg.of("globalPosition", globalPosition),
|
142 |
| - SafeArg.of("columnFamilies", FBUtilities.toString(cfPersisted))); |
| 148 | + SafeArg.of("columnFamiliesWithReplayFilters", cfPersisted.keySet()), |
| 149 | + SafeArg.of("columnFamiliesWithoutReplayFilters", cfWithoutFilter)); |
143 | 150 | return new CommitLogReplayer(commitLog, globalPosition, cfPersisted, replayFilter);
|
144 | 151 | }
|
145 | 152 |
|
@@ -464,17 +471,18 @@ public void recover(File file, boolean tolerateTruncation) throws IOException
|
464 | 471 | finally
|
465 | 472 | {
|
466 | 473 | FileUtils.closeQuietly(reader);
|
467 |
| - logger.debug("Finished reading {}", file); |
| 474 | + logger.debug("Finished reading {}", |
| 475 | + SafeArg.of("file", file.getName())); |
468 | 476 | }
|
469 | 477 | }
|
470 | 478 |
|
471 | 479 | public boolean logAndCheckIfShouldSkip(File file, CommitLogDescriptor desc)
|
472 | 480 | {
|
473 | 481 | logger.debug("Replaying {} (CL version {}, messaging version {}, compression {})",
|
474 |
| - file.getPath(), |
475 |
| - desc.version, |
476 |
| - desc.getMessagingVersion(), |
477 |
| - desc.compression); |
| 482 | + SafeArg.of("file", file.getName()), |
| 483 | + SafeArg.of("version", desc.version), |
| 484 | + SafeArg.of("messagingVersion", desc.getMessagingVersion()), |
| 485 | + UnsafeArg.of("compression", desc.compression)); |
478 | 486 |
|
479 | 487 | if (globalPosition.segment > desc.id)
|
480 | 488 | {
|
|
0 commit comments