File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 36
36
#include " reflection/adl.h"
37
37
#include " rpc/types.h"
38
38
#include " ssx/future-util.h"
39
+ #include " ssx/watchdog.h"
39
40
#include " storage/api.h"
40
41
#include " storage/kvstore.h"
41
42
#include " storage/ntp_config.h"
@@ -2655,10 +2656,21 @@ ss::future<> consensus::write_snapshot(write_snapshot_cfg cfg) {
2655
2656
co_return ;
2656
2657
}
2657
2658
2658
- // Release the lock when truncating the log because it can take some
2659
- // time while we wait for readers to be evicted.
2660
- co_await _log->truncate_prefix (
2661
- storage::truncate_prefix_config (model::next_offset (last_included_index)));
2659
+ {
2660
+ auto truncation_offset = model::next_offset (last_included_index);
2661
+ ssx::watchdog wd15min (15min, [this , truncation_offset] {
2662
+ vlog (
2663
+ _ctxlog.warn ,
2664
+ " Truncation at offset {} is taking more than 15min, log offsets: "
2665
+ " {}" ,
2666
+ truncation_offset,
2667
+ _log->offsets ());
2668
+ });
2669
+ // Release the lock when truncating the log because it can take some
2670
+ // time while we wait for readers to be evicted.
2671
+ co_await _log->truncate_prefix (
2672
+ storage::truncate_prefix_config (truncation_offset));
2673
+ }
2662
2674
2663
2675
/*
2664
2676
* We do not need to keep an oplock when updating the flushed offset here as
You can’t perform that action at this time.
0 commit comments