Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
more telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyk-91 committed Sep 16, 2024
1 parent a83e040 commit 6c7ad36
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,7 @@ private static TargetedSweeper uninitializedTargetedSweeper(
CoordinationAwareKnownAbandonedTransactionsStore abandonedTxnStore =
new CoordinationAwareKnownAbandonedTransactionsStore(
coordinationService, new AbandonedTimestampStoreImpl(kvs));
log.info("[PDS-586351] Creating an uninitialized targeted sweeper...");
return TargetedSweeper.createUninitialized(
metricsManager,
runtime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import com.palantir.atlasdb.memory.InMemoryAtlasDbConfig;
import com.palantir.atlasdb.sweep.queue.config.TargetedSweepInstallConfig.SweepIndexResetProgressStage;
import com.palantir.conjure.java.api.config.ssl.SslConfiguration;
import java.io.File;
import java.io.IOException;
Expand All @@ -42,6 +43,9 @@ public void canDeserializeAtlasDbConfig() throws IOException {
assertTimeLockConfigDeserializedCorrectly(config.timelock().get());

assertThat(config.leader()).isNotPresent();

assertThat(config.targetedSweep().sweepIndexResetProgressStage())
.isEqualTo(SweepIndexResetProgressStage.WRITE_IMMEDIATE_FORMAT_AND_SKIP_UNKNOWNS);
}

@Test
Expand Down
2 changes: 2 additions & 0 deletions atlasdb-config/src/test/resources/test-config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
atlasdb:
namespace: brian
targetedSweep:
sweepIndexResetProgressStage: WRITE_IMMEDIATE_FORMAT_AND_SKIP_UNKNOWNS

keyValueService:
type: memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ static SweepQueueFactory create(
Function<TableReference, Optional<LogSafety>> tablesToTrackDeletions,
SweepIndexResetProgressStage resetProgressStage) {
Schemas.createTablesAndIndexes(TargetedSweepSchema.INSTANCE.getLatestSchema(), kvs);
log.info("[PDS-586351] Creating a sweep queue factory...");
if (resetProgressStage.shouldInvalidateOldMappings()) {
log.info("Invalidating old sweep mappings... now truncating sweep identifier tables.");

Expand All @@ -329,7 +330,13 @@ static SweepQueueFactory create(
e);
throw e;
}
} else {
log.info(
"Not invalidating old sweep mappings, because we don't believe we've been configured to do"
+ " this.",
SafeArg.of("resetProgressStage", resetProgressStage));
}

ShardProgress shardProgress = new ShardProgress(kvs);
Supplier<Integer> shards =
createProgressUpdatingSupplier(shardsConfig, shardProgress, SweepQueueUtils.REFRESH_TIME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ public static TargetedSweeper createUninitializedForTest(KeyValueService kvs, Su

@Override
public void initialize(TransactionManager txManager) {
log.info("[PDS-586351] Initializing targeted sweep...");
initializeWithoutRunning(txManager);
log.info("[PDS-586351] Initialized targeted sweep, now running in background...");
runInBackground();
}

Expand Down Expand Up @@ -171,8 +173,10 @@ public void initializeWithoutRunning(
TransactionService transaction,
TargetedSweepFollower follower) {
if (isInitialized) {
log.info("[PDS-586351] Targeted sweep thinks it's already initialized...");
return;
}
log.info("[PDS-586351] Now initializing targeted sweep, given an initialized kvs...");
Preconditions.checkState(
kvs.isInitialized(), "Attempted to initialize targeted sweeper with an uninitialized backing KVS.");
metrics = TargetedSweepMetrics.create(
Expand All @@ -181,6 +185,7 @@ public void initializeWithoutRunning(
kvs,
metricsConfiguration,
runtime.get().shards());
log.info("[PDS-586351] Initializing a sweep queue...");
queue = SweepQueue.create(
metrics,
kvs,
Expand Down

0 comments on commit 6c7ad36

Please sign in to comment.