Skip to content

Commit e35f2cd

Browse files
committed
fix(msgpack): correct map annotations and remove redundant defaults
Add missing #[msgpack(map)] to InstallSnapshotRequest, StrictSchema, NativeResponse, and MoveTenantJournalEntry so zerompk 0.5 serialises them as named-field maps rather than arrays, matching the wire format. Remove #[msgpack(default)] from Optional fields in the physical plan types (columnar, timeseries, kv, query, document ops). zerompk 0.5 treats absent map keys as default for Option<T> unconditionally, so the attribute is now redundant and its presence caused compile warnings.
1 parent a4d37a6 commit e35f2cd

9 files changed

Lines changed: 4 additions & 19 deletions

File tree

nodedb-raft/src/message.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ pub struct RequestVoteResponse {
138138
zerompk::ToMessagePack,
139139
zerompk::FromMessagePack,
140140
)]
141+
#[msgpack(map)]
141142
pub struct InstallSnapshotRequest {
142143
/// Leader's term.
143144
pub term: u64,

nodedb-types/src/columnar/schema.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub trait SchemaOps {
4343
zerompk::ToMessagePack,
4444
zerompk::FromMessagePack,
4545
)]
46+
#[msgpack(map)]
4647
pub struct StrictSchema {
4748
pub columns: Vec<ColumnDef>,
4849
pub version: u32,

nodedb-types/src/protocol/frames.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ impl<'a> zerompk::FromMessagePack<'a> for NativeRequest {
5858
#[derive(
5959
Debug, Clone, Serialize, Deserialize, zerompk::ToMessagePack, zerompk::FromMessagePack,
6060
)]
61+
#[msgpack(map)]
6162
pub struct NativeResponse {
6263
/// Echoed from the request for correlation.
6364
pub seq: u64,

nodedb/src/bridge/physical_plan/columnar.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,16 @@ pub enum ColumnarOp {
6969
/// is ≤ this value. `None` = current-state read. Only populated
7070
/// for collections created `WITH BITEMPORAL`.
7171
#[serde(default)]
72-
#[msgpack(default)]
7372
system_as_of_ms: Option<i64>,
7473
/// Bitemporal valid-time predicate: keep rows whose
7574
/// `[_ts_valid_from, _ts_valid_until)` interval contains this
7675
/// point. `None` = no valid-time filter.
7776
#[serde(default)]
78-
#[msgpack(default)]
7977
valid_at_ms: Option<i64>,
8078
/// Optional surrogate prefilter injected by a cross-engine sub-plan.
8179
/// When present, the scan skips rows whose surrogate is absent from
8280
/// this bitmap. `None` = no prefilter; full collection is scanned.
8381
#[serde(default)]
84-
#[msgpack(default)]
8582
prefilter: Option<SurrogateBitmap>,
8683
},
8784

nodedb/src/bridge/physical_plan/document/op.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ pub enum DocumentOp {
9292
pk_bytes: Vec<u8>,
9393
/// When `Some`, return the pre-deletion document projected per spec.
9494
#[serde(default)]
95-
#[msgpack(default)]
9695
returning: Option<ReturningSpec>,
9796
},
9897

@@ -109,7 +108,6 @@ pub enum DocumentOp {
109108
updates: Vec<(String, UpdateValue)>,
110109
/// When `Some`, return the post-update document projected per spec.
111110
#[serde(default)]
112-
#[msgpack(default)]
113111
returning: Option<ReturningSpec>,
114112
},
115113

@@ -138,7 +136,6 @@ pub enum DocumentOp {
138136
/// When present, the scan skips rows whose surrogate is absent from
139137
/// this bitmap. `None` = no prefilter; full collection is scanned.
140138
#[serde(default)]
141-
#[msgpack(default)]
142139
prefilter: Option<SurrogateBitmap>,
143140
},
144141

@@ -295,7 +292,6 @@ pub enum DocumentOp {
295292
/// Additional WHERE predicates applying only to the target (msgpack).
296293
target_filters: Vec<u8>,
297294
#[serde(default)]
298-
#[msgpack(default)]
299295
returning: Option<ReturningSpec>,
300296
},
301297

@@ -306,7 +302,6 @@ pub enum DocumentOp {
306302
updates: Vec<(String, UpdateValue)>,
307303
/// When `Some`, return updated documents projected per spec.
308304
#[serde(default)]
309-
#[msgpack(default)]
310305
returning: Option<ReturningSpec>,
311306
/// Optimistic pre-execution predicted matching surrogates (OLLP path).
312307
///
@@ -315,7 +310,6 @@ pub enum DocumentOp {
315310
/// mismatch the executor returns `ErrorCode::OllpRetryRequired` without
316311
/// writing. `None` on the non-OLLP (static-set) path — no verification.
317312
#[serde(default)]
318-
#[msgpack(default)]
319313
ollp_predicted_surrogates: Option<Vec<u32>>,
320314
},
321315

@@ -325,7 +319,6 @@ pub enum DocumentOp {
325319
filters: Vec<u8>,
326320
/// When `Some`, return pre-deletion documents projected per spec.
327321
#[serde(default)]
328-
#[msgpack(default)]
329322
returning: Option<ReturningSpec>,
330323
/// Optimistic pre-execution predicted matching surrogates (OLLP path).
331324
///
@@ -334,7 +327,6 @@ pub enum DocumentOp {
334327
/// mismatch the executor returns `ErrorCode::OllpRetryRequired` without
335328
/// writing. `None` on the non-OLLP (static-set) path — no verification.
336329
#[serde(default)]
337-
#[msgpack(default)]
338330
ollp_predicted_surrogates: Option<Vec<u32>>,
339331
},
340332

@@ -358,7 +350,6 @@ pub enum DocumentOp {
358350
source_join_col: String,
359351
clauses: Vec<MergeClauseOp>,
360352
#[serde(default)]
361-
#[msgpack(default)]
362353
returning: Option<ReturningSpec>,
363354
},
364355

nodedb/src/bridge/physical_plan/kv.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ pub enum KvOp {
3232
/// source allocated AFTER the clone's AS-OF must not leak
3333
/// through. `None` for normal (non-clone-delegated) gets.
3434
#[serde(default)]
35-
#[msgpack(default)]
3635
surrogate_ceiling: Option<u32>,
3736
},
3837

@@ -114,7 +113,6 @@ pub enum KvOp {
114113
/// Sort keys: `(field, descending)` pairs applied to the scan result
115114
/// before encoding. Empty = unsorted (engine native order).
116115
#[serde(default)]
117-
#[msgpack(default)]
118116
sort_keys: Vec<(String, bool)>,
119117
/// Clone snapshot-isolation ceiling: when set, scan results
120118
/// drop entries whose surrogate exceeds this value. Populated
@@ -123,7 +121,6 @@ pub enum KvOp {
123121
/// allocated AFTER the clone's AS-OF must not leak through.
124122
/// `None` for normal (non-clone-delegated) scans.
125123
#[serde(default)]
126-
#[msgpack(default)]
127124
surrogate_ceiling: Option<u32>,
128125
},
129126

nodedb/src/bridge/physical_plan/query.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub enum QueryOp {
7070
/// for plain GROUP BY). The executor applies the sort after all
7171
/// groups are finalized and HAVING is filtered.
7272
#[serde(default)]
73-
#[msgpack(default)]
7473
sort_keys: Vec<(String, bool)>,
7574
},
7675

nodedb/src/bridge/physical_plan/timeseries.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ pub enum TimeseriesOp {
4848
/// written after the given epoch-ms. Only populated for
4949
/// timeseries collections created `WITH BITEMPORAL`.
5050
#[serde(default)]
51-
#[msgpack(default)]
5251
system_as_of_ms: Option<i64>,
5352
/// Bitemporal valid-time point. When `Some`, only rows whose
5453
/// `[_ts_valid_from, _ts_valid_until)` interval contains this
5554
/// point are returned.
5655
#[serde(default)]
57-
#[msgpack(default)]
5856
valid_at_ms: Option<i64>,
5957
},
6058

@@ -78,7 +76,6 @@ pub enum TimeseriesOp {
7876
/// CP-driven re-derivation pattern is owned by the timeseries
7977
/// engine integration.
8078
#[serde(default)]
81-
#[msgpack(default)]
8279
surrogates: Vec<Surrogate>,
8380
},
8481
}

nodedb/src/control/server/pgwire/ddl/tenant/move_tenant/journal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pub enum MovePhase {
4040

4141
/// Persisted state for a single in-progress `MOVE TENANT` operation.
4242
#[derive(zerompk::ToMessagePack, zerompk::FromMessagePack, Debug, Clone)]
43+
#[msgpack(map)]
4344
pub struct MoveTenantJournalEntry {
4445
pub tenant_id: u64,
4546
pub tenant_name: String,

0 commit comments

Comments
 (0)