From 4c72cd76ee3281ed0218617857d9093f36f7e6ce Mon Sep 17 00:00:00 2001 From: Samuel Souza Date: Wed, 11 Oct 2017 20:21:09 +0100 Subject: [PATCH] Copy over #2444 --- .../com/palantir/atlasdb/sweep/BackgroundSweeperImpl.java | 8 ++++++-- .../com/palantir/atlasdb/sweep/SpecificTableSweeper.java | 8 ++++++-- docs/source/release_notes/release-notes.rst | 5 +++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/BackgroundSweeperImpl.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/BackgroundSweeperImpl.java index 1fe1006953f..e214321b538 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/BackgroundSweeperImpl.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/BackgroundSweeperImpl.java @@ -148,9 +148,13 @@ private long grabLocksAndRun(SweepLocks locks) throws InterruptedException { log.info("The table being swept by the background sweeper was dropped, moving on..."); } else { SweepBatchConfig lastBatchConfig = getAdjustedBatchConfig(); - log.warn("The background sweep job failed unexpectedly with batch config {}." + log.warn("The background sweep job failed unexpectedly with candidate batch size {}," + + " delete batch size {}," + + " and {} cell+timestamp pairs to examine." + " Attempting to continue with a lower batch size...", - SafeArg.of("cell batch size", lastBatchConfig), + SafeArg.of("candidateBatchSize", lastBatchConfig.candidateBatchSize()), + SafeArg.of("deleteBatchSize", lastBatchConfig.deleteBatchSize()), + SafeArg.of("maxCellTsPairsToExamine", lastBatchConfig.maxCellTsPairsToExamine()), e); // Cut batch size in half, always sweep at least one row (we round down). batchSizeMultiplier = Math.max(batchSizeMultiplier / 2, 1.5 / lastBatchConfig.candidateBatchSize()); diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/SpecificTableSweeper.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/SpecificTableSweeper.java index c4935a34c12..c3ff9f0ae96 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/SpecificTableSweeper.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/SpecificTableSweeper.java @@ -161,10 +161,14 @@ void runOnceForTable(TableToSweep tableToSweep, // This error may be logged on some paths above, but I prefer to log defensively. log.info("Failed to sweep table {}" + " at row {}" - + " with batch config {}.", + + " with candidate batch size {}," + + " delete batch size {}," + + " and {} cell+timestamp pairs to examine.", LoggingArgs.tableRef("tableRef", tableRef), UnsafeArg.of("startRow", startRowToHex(startRow)), - SafeArg.of("batchConfig", batchConfig), + SafeArg.of("candidateBatchSize", batchConfig.candidateBatchSize()), + SafeArg.of("deleteBatchSize", batchConfig.deleteBatchSize()), + SafeArg.of("maxCellTsPairsToExamine", batchConfig.maxCellTsPairsToExamine()), e); throw e; } diff --git a/docs/source/release_notes/release-notes.rst b/docs/source/release_notes/release-notes.rst index 9bebf09619a..f4c34892436 100644 --- a/docs/source/release_notes/release-notes.rst +++ b/docs/source/release_notes/release-notes.rst @@ -107,6 +107,11 @@ develop We now throw the actual cause for the invocation exception. (`Pull Request `__) + * - |fixed| + - Sweep candidate batches are now logged correctly. + Previously, we would log a ``SafeArg`` for these batches that had no content. + (`Pull Request `__) + .. <<<<------------------------------------------------------------------------------------------------------------->>>> =======