Skip to content

Commit 873593a

Browse files
committed
wip
1 parent a6eacaf commit 873593a

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/ci/deploy/config/databend-query-node-1.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ join_spilling_memory_ratio = 60
8282
[log]
8383

8484
[log.file]
85-
level = "INFO"
85+
level = "DEBUG"
8686
format = "text"
8787
dir = "./.databend/logs_1"
8888
limit = 12 # 12 files, 1 file per hour

src/query/ee/src/storages/fuse/operations/vacuum_table_v2.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@ pub async fn do_vacuum2(
9292

9393
let retention_policy = fuse_table.get_data_retention_policy(ctx.as_ref())?;
9494

95+
// Indicates whether to use the current table snapshot as gc root,
96+
// true means vacuum all the historical snapshots.
9597
let mut is_vacuum_all = false;
9698

9799
let mut respect_flash_back_with_lvt = None;
98100
let snapshots_before_lvt = match retention_policy {
99101
RetentionPolicy::ByTimePeriod(delta_duration) => {
100102
let retention_period = if fuse_table.is_transient() {
101-
// for transient table, keep no history data
103+
// For transient table, keep no history data
102104
TimeDelta::zero()
103105
} else {
104106
delta_duration
@@ -176,15 +178,14 @@ pub async fn do_vacuum2(
176178
}
177179
if num_snapshot_to_keep == 1 {
178180
// Expecting only one snapshot left, which means that we can use the current snapshot
179-
// as gc root, this flag will be propagated to the select_gc_root routine later.
181+
// as gc root, this flag will be propagated to the select_gc_root func later.
180182
is_vacuum_all = true;
181183
}
182184

183-
// Later while selecting gc root, that last one of the `snapshots` will be used as gc
184-
// candidate(which we are not sure about if it has been successfully committed).
185+
// When selecting the GC root later, the last snapshot in `snapshots` is a candidate,
186+
// but its commit status is uncertain, its previous snapshot is typically used as the GC root, except in the is_vacuum_all case.
185187
//
186-
// The previous snapshot of the candidate will be used as the GC root (expect for the is_vacuum_all scenario).
187-
// Thus while truncating the snapshots, we should keep 2 extras snapshots; see `select_gc_root` for more details.
188+
// Therefore, during snapshot truncation, we keep 2 extra snapshots; see `select_gc_root` for details.
188189
let num_candidates = len - num_snapshot_to_keep + 2;
189190
snapshots.truncate(num_candidates);
190191
snapshots

src/query/ee_features/vacuum_handler/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ edition = { workspace = true }
1010
[dependencies]
1111
async-backtrace = { workspace = true }
1212
async-trait = { workspace = true }
13-
chrono = { workspace = true }
1413
databend-common-base = { workspace = true }
1514
databend-common-catalog = { workspace = true }
1615
databend-common-exception = { workspace = true }

0 commit comments

Comments
 (0)