mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-12-04 00:15:29 +00:00
fix: fence reads across repartition data handoff
Reject query planning during repartition handoff and keep new targets pending until all manifests have been applied. Carry planned partition versions to datanodes and validate the pinned scan snapshot, including retiring merge sources. Preserve retryable read errors and cover cached routes, transport, metric mapping, and scope changes. Signed-off-by: WenyXu <wenymedia@gmail.com>
This commit is contained in:
@@ -228,17 +228,17 @@ pub enum WriteRoutePolicy {
|
||||
IgnoreAllWrites,
|
||||
}
|
||||
|
||||
// Presence, rather than the value, hides a newly allocated repartition target.
|
||||
// Presence, rather than the value, marks an incomplete repartition read handoff.
|
||||
const REPARTITION_PENDING_READ: &str = "greptime:repartition-pending-read";
|
||||
|
||||
impl RegionRoute {
|
||||
/// Whether allocation has published this target before its logical regions are ready.
|
||||
/// Old routes without this attribute remain readable. Unknown values also remain hidden.
|
||||
/// Whether allocation has published this target before the read handoff completes.
|
||||
/// Old routes without this attribute remain readable. Unknown values also mark a pending handoff.
|
||||
pub fn is_repartition_pending_read(&self) -> bool {
|
||||
self.region.attrs.contains_key(REPARTITION_PENDING_READ)
|
||||
}
|
||||
|
||||
/// Hides a newly allocated target until its logical regions have been synchronized.
|
||||
/// Marks a newly allocated target until the repartition read handoff completes.
|
||||
pub fn set_repartition_pending_read(&mut self) {
|
||||
self.region
|
||||
.attrs
|
||||
|
||||
Reference in New Issue
Block a user