Skip to content

fix(timeseries): correct ILP shard routing and scan column output#1

Closed
emanzx wants to merge 1 commit intoNodeDB-Lab:mainfrom
emanzx:fix/timeseries-ilp-scan
Closed

fix(timeseries): correct ILP shard routing and scan column output#1
emanzx wants to merge 1 commit intoNodeDB-Lab:mainfrom
emanzx:fix/timeseries-ilp-scan

Conversation

@emanzx
Copy link
Copy Markdown
Contributor

@emanzx emanzx commented Mar 29, 2026

Summary

  • Fix ILP shard routing mismatch: ILP ingest used VShardId::from_key() (FxHash) while SQL scan used VShardId::from_collection() (DJB hash) — same collection name routed to different Data Plane cores, making ingested data invisible to queries. Now both use from_collection().
  • Fix hardcoded scan output: Timeseries scan only emitted timestamp and value columns. Now iterates all memtable schema columns and resolves Symbol (tag) columns through the SymbolDictionary.

Test plan

  • ILP ingest 43K+ rows at ~485K rows/sec with zero errors
  • SELECT * FROM metrics LIMIT 5 returns all columns (host, region, cpu_usage, mem_usage, timestamp)
  • Tag columns (Symbol type) correctly resolved to string values
  • cargo clippy clean, cargo fmt --all applied

🤖 Generated with Claude Code

ILP ingest used VShardId::from_key() (FxHash) for per-series core
routing while the SQL scan planner used VShardId::from_collection()
(DJB hash). Different hash functions on the same collection name
routed data and queries to different Data Plane cores, making
ingested timeseries data invisible to scans.

Additionally, the timeseries scan handler only emitted hardcoded
"timestamp" and "value" columns, ignoring all other columns
(tags, additional fields) stored in the columnar memtable.

Changes:
- ILP listener now routes via VShardId::from_collection() to match
  the scan planner. Per-series sharding deferred until scan supports
  fan-out across cores.
- Scan handler iterates all memtable schema columns and resolves
  Symbol (tag) columns through the SymbolDictionary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@emanzx emanzx closed this Mar 29, 2026
@emanzx emanzx deleted the fix/timeseries-ilp-scan branch March 29, 2026 12:43
farhan-syah added a commit that referenced this pull request Apr 5, 2026
Fix #1: TriggerBatchRow now decodes msgpack directly to
HashMap<String, nodedb_types::Value> via rmpv, skipping the
serde_json::Value intermediate entirely. The full chain:
  raw bytes → rmpv::Value → nodedb_types::Value (direct)
Previously: raw bytes → serde_json::Value → nodedb_types::Value

- TriggerBatchRow cache type: serde_json::Map → HashMap<String, Value>
- Added rmpv_to_value() converter (msgpack → nodedb_types::Value)
- fire_after/before/instead/common: params changed from
  &serde_json::Map to &HashMap<String, Value>
- Removed map_to_hashmap() — no longer needed
- dml_hook.rs: deserialize_value_to_fields returns Value map directly
- RetryEntry: fields changed to HashMap<String, Value>
- dispatcher: converts at WriteEvent boundary (one remaining point)

Fix #2: dispatch/other.rs tuple responses (Vec<(u64,i64,f64)>,
Option<(i64,f64)>) now use encode() directly instead of encode_serde()
since zerompk implements ToMessagePack for tuples natively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant