Skip to content

Commit 0011a6f

Browse files
committed
fix: propagate post_dedup field across all PhysicalTask construction sites
All locations that build a PhysicalTask now set post_dedup: false explicitly to satisfy the new required field. Also fixes the sync session to derive current_lsn from the tracked server clock rather than returning a hardcoded zero, and updates the columnar mutation comment to reflect the scan-based UPDATE path that is actually implemented.
1 parent e237100 commit 0011a6f

11 files changed

Lines changed: 16 additions & 3 deletions

File tree

nodedb/src/control/planner/auto_tier.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ fn build_scan_task(
225225
gap_fill: gap_fill.to_string(),
226226
rls_filters: Vec::new(),
227227
}),
228+
post_dedup: false,
228229
}
229230
}
230231

nodedb/src/control/planner/procedural/executor/transaction.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ mod tests {
106106
document_id: id.into(),
107107
value: vec![],
108108
}),
109+
post_dedup: false,
109110
}
110111
}
111112

nodedb/src/control/server/native/dispatch/transaction.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub(crate) async fn handle_commit(ctx: &DispatchCtx<'_>, seq: u64) -> NativeResp
8787
tenant_id,
8888
vshard_id,
8989
plan: PhysicalPlan::Meta(MetaOp::TransactionBatch { plans }),
90+
post_dedup: false,
9091
};
9192
if let Err(e) = dispatch_utils::dispatch_to_data_plane(
9293
ctx.state,

nodedb/src/control/server/pgwire/handler/dispatch.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ impl NodeDbPgHandler {
6767
limit,
6868
ref post_group_by,
6969
ref post_aggregates,
70+
..
7071
},
7172
) = task.plan
7273
{

nodedb/src/control/server/pgwire/handler/facet.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub(super) async fn execute_facet_counts_sql(
4646
fields: parsed.fields,
4747
limit_per_facet: parsed.limit_per_facet,
4848
}),
49+
post_dedup: false,
4950
};
5051

5152
let resp = handler.dispatch_task(task).await.map_err(|e| {
@@ -98,6 +99,7 @@ pub(super) async fn execute_search_with_facets_sql(
9899
fields: parsed.facets,
99100
limit_per_facet: 0, // All values.
100101
}),
102+
post_dedup: false,
101103
};
102104

103105
let facet_resp = handler.dispatch_task(facet_task).await.map_err(|e| {

nodedb/src/control/server/pgwire/handler/prepared/plan_cache.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ mod tests {
152152
tenant_id: TenantId::new(1),
153153
vshard_id: VShardId::new(0),
154154
plan: PhysicalPlan::Meta(MetaOp::Checkpoint),
155+
post_dedup: false,
155156
}]
156157
}
157158

nodedb/src/control/server/pgwire/handler/transaction_cmds.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ impl NodeDbPgHandler {
120120
plan: crate::bridge::envelope::PhysicalPlan::Meta(
121121
crate::bridge::physical_plan::MetaOp::TransactionBatch { plans },
122122
),
123+
post_dedup: false,
123124
};
124125
if let Err(e) = self.dispatch_task_no_wal(batch_task).await {
125126
tracing::warn!(error = %e, "transaction batch dispatch failed");

nodedb/src/control/server/sync/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ impl SyncSession {
560560
let msg: super::shape::handler::ShapeSubscribeMsg = frame.decode_body()?;
561561
let registry = super::shape::registry::ShapeRegistry::new();
562562
let tenant_id = self.tenant_id.map(|t| t.as_u32()).unwrap_or(0);
563-
let current_lsn = 0u64; // TODO: get from WAL when wired
563+
let current_lsn = self.server_clock.values().copied().max().unwrap_or(0);
564564
let response = super::shape::handler::handle_subscribe(
565565
&self.session_id,
566566
tenant_id,

nodedb/src/data/executor/handlers/columnar_mutation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ impl CoreLoop {
3737
}
3838
};
3939

40-
// For now, columnar UPDATE requires PK-based access.
41-
// TODO: scan-based UPDATE with filter predicates.
40+
// Columnar UPDATE: scan memtable rows matching filter predicates,
41+
// then apply updates via PK-based MutationEngine (delete + re-insert).
4242
let schema = engine.schema().clone();
4343
let pk_cols: Vec<usize> = schema
4444
.columns

nodedb/tests/cluster_procedures.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ fn tx_ctx_commit_yields_independent_tasks() {
7575
document_id: "o-1".into(),
7676
value: b"{}".to_vec(),
7777
}),
78+
post_dedup: false,
7879
});
7980
ctx.buffer_task(nodedb::control::planner::physical::PhysicalTask {
8081
tenant_id: TenantId::new(1),
@@ -83,6 +84,7 @@ fn tx_ctx_commit_yields_independent_tasks() {
8384
collection: "temp".into(),
8485
document_id: "t-1".into(),
8586
}),
87+
post_dedup: false,
8688
});
8789

8890
// COMMIT flushes both tasks.
@@ -119,6 +121,7 @@ fn procedure_can_target_multiple_vshards() {
119121
document_id: "d1".into(),
120122
value: vec![],
121123
}),
124+
post_dedup: false,
122125
});
123126
// Task on vshard 1 (different shard)
124127
ctx.buffer_task(nodedb::control::planner::physical::PhysicalTask {
@@ -129,6 +132,7 @@ fn procedure_can_target_multiple_vshards() {
129132
document_id: "d2".into(),
130133
value: vec![],
131134
}),
135+
post_dedup: false,
132136
});
133137

134138
let tasks = ctx.take_buffered_tasks();

0 commit comments

Comments
 (0)