diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/TransactionManagers.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/TransactionManagers.java index 9df0b53032a..5baabcdeb2c 100644 --- a/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/TransactionManagers.java +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/factory/TransactionManagers.java @@ -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, diff --git a/atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbConfigDeserializationTest.java b/atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbConfigDeserializationTest.java index d144fa326af..bbf035fe940 100644 --- a/atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbConfigDeserializationTest.java +++ b/atlasdb-config/src/test/java/com/palantir/atlasdb/config/AtlasDbConfigDeserializationTest.java @@ -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; @@ -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 diff --git a/atlasdb-config/src/test/resources/test-config.yml b/atlasdb-config/src/test/resources/test-config.yml index 8c0fc9c2cc8..a202629e828 100644 --- a/atlasdb-config/src/test/resources/test-config.yml +++ b/atlasdb-config/src/test/resources/test-config.yml @@ -1,5 +1,7 @@ atlasdb: namespace: brian + targetedSweep: + sweepIndexResetProgressStage: WRITE_IMMEDIATE_FORMAT_AND_SKIP_UNKNOWNS keyValueService: type: memory diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/SweepQueue.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/SweepQueue.java index d13ac1a0eab..dac1c42b3ec 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/SweepQueue.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/SweepQueue.java @@ -310,6 +310,7 @@ static SweepQueueFactory create( Function> 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."); @@ -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 shards = createProgressUpdatingSupplier(shardsConfig, shardProgress, SweepQueueUtils.REFRESH_TIME); diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/TargetedSweeper.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/TargetedSweeper.java index 4d105dd0623..ba87674a9d8 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/TargetedSweeper.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/queue/TargetedSweeper.java @@ -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(); } @@ -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( @@ -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,