You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If users don't specify time window explicitly, the compactor will infer a time window and apply it to the version. But the region can only set that window to the memtable after reopening the region.
let part_duration = options.compaction.time_window();
// Initial memtable id is 0.
let mutable = Arc::new(TimePartitions::new(
metadata.clone(),
memtable_builder.clone(),
0,
part_duration,
));
We should set the part duration to TimePartitions according to the time window.
Implementation challenges
Setting the part duration for TimePartitions has several challenges:
The TimePartitions struct doesn't support updating the part_duration now.
If a TimePartitions struct holds partitions with the old time window, then we should not override its part duration.
If we alter compaction time window, should we also alter the part duration?
Instead of altering the part duration, maybe we can create a new TimePartitions with the new time window. It's possible to set this in MemtableVersion::freeze_mutable.
What type of enhancement is this?
Tech debt reduction
What does the enhancement do?
If users don't specify time window explicitly, the compactor will infer a time window and apply it to the version. But the region can only set that window to the memtable after reopening the region.
greptimedb/src/mito2/src/region/opener.rs
Lines 211 to 218 in 7d8b256
We should set the part duration to
TimePartitions
according to the time window.Implementation challenges
Setting the part duration for
TimePartitions
has several challenges:TimePartitions
struct doesn't support updating thepart_duration
now.TimePartitions
struct holds partitions with the old time window, then we should not override its part duration.Instead of altering the part duration, maybe we can create a new
TimePartitions
with the new time window. It's possible to set this inMemtableVersion::freeze_mutable
.greptimedb/src/mito2/src/memtable/version.rs
Lines 73 to 82 in 7d8b256
The text was updated successfully, but these errors were encountered: