-
Notifications
You must be signed in to change notification settings - Fork 1
Module sharding Roadmap
Production-capable sharding runtime exists for routing/placement, distributed coordination, cross-shard transaction execution, and rebalancing/repair/operational observability.
Wave Alignment (see root ROADMAP.md § Program Execution Model):
- Wave A (Q3–Q4 2026): Multi-shard exact-path gate (Phase C), topology-change auto-rebalance, latency-aware routing, distributed write stress
- Wave A Exit Criteria: Deterministic chaos evidence (network partition, coordinator failure, cascade) + thread-safety sign-off + release-critical CI GREEN + p95/p99 baselines
- Tier 1 Criticality: Runtime-critical for distributed databases; thread-safety and fail-closed guarantees mandatory
- Rollout Readiness: 35% 🔴 (Phase A ready, Phase B/C blocked on thread-safety gates)
Hybrid Retrieval Rollout Readiness: 35% 🔴 (issue #5468).
- Phase A (single-shard exact): ✅ Ready — single-shard path is stable.
- Phase B (multi-shard exact): ❌ Q3 2026 — blocked by 340+ cross-shard thread-safety gaps.
- Phase C (distributed summary-first): ❌ Q4 2026 — requires consensus coordination robustness.
- Critical: Multi-shard is disabled until Phase C thread-safety and lock-ordering gates pass.
- Rollout risk detail:
ai_working/HYBRID_RETRIEVAL_ROLLOUT_PLAN.md §7
- P6-01 (2026-07-20): 32 GTest cases for 2PC/3PC consistency verification delivered in
tests/sharding/test_sharding_phase6_hardening.cpp(TXC-01..TXC-32). All cases pass with deterministic seed-42 simulation; commit/abort/WAL/replay guarantees validated in-process. - P6-02 (2026-07-20): 20 GTest cases for failover logic and recovery-path hardening delivered in
tests/sharding/test_sharding_phase6_hardening.cpp(FLR-01..FLR-20). Coordinator crash + WAL re-drive + idempotent recovery scenarios all verified. - P6-03 (2026-07-22): 40 Wave-8 fault injection GTest cases delivered in
tests/sharding/test_sharding_p6_fault_injection.cpp(FI-01..FI-40). Covers: network partition (FI-01..FI-15), coordinator failure (FI-16..FI-25), cascade/multi-failure (FI-26..FI-40). All 40 tests registered asrelease_criticalintests/sharding/CMakeLists.txt. - P6 Sign-off (2026-07-22): sign-off artefacts at
docs/sharding/SHARDING_P6_SIGN_OFF.md.- P6-01 sign-off: commit/abort/WAL/replay guarantees documented and validated (TXC-01..TXC-32 all green)
- P6-02 sign-off: failover/recovery deterministic evidence bundle completed (FLR-01..FLR-20 all green)
- P6-03 sign-off: Wave-8 fault-injection chain integrated into GA gate board (FI-01..FI-40 registered
release_critical)
- [~] hardening distributed failure-path behavior under shard outage and quorum stress (Target: Q3 2026)
- [~] improving diagnostics consistency across routing/transaction/repair stages (Target: Q3 2026)
- [~] stabilizing benchmark-backed release guardrails for sharding hot paths (Target: Q3 2026)
- Real AWS S3, Azure Storage, and Google Cloud Storage SDK integrations for cloud backup (Target: Q2 2026)
- Phase C pre-requisite: fix 70% of cross-shard thread-safety gaps (340+ → ~102) (delivered 2026-08-10, verified 2026-08-17)
- Fixes:
dual_consensus_orchestrator.cppdeadlock inupdateConsistencyState,getMetricslock-ordering violation (metrics_mutex_→state_mutex_), unprotected callback fields, unprotectedbackground_sync_interval_, data race onconflict_callback_inreplica_consistency.cpp, and detached-thread shared-state hazards. - Verification: All fixes verified in source code; std::scoped_lock for atomic dual acquisition at line 829; getMetrics() no longer holds metrics_mutex_ while accessing state_mutex_ protected paths
- Test evidence: TSO-01..TSO-08 in
tests/sharding/test_sharding_thread_safety_lock_order_focused.cpp
- Fixes:
- Phase C pre-requisite: consistent lock ordering enforcement — lock ordering violations (95 → 0) (delivered 2026-08-10, verified 2026-08-17)
- Canonical order documented in headers:
state_mutex_(1) <audit_mutex_(2) <metrics_mutex_(3) forDualConsensusOrchestrator;state_mutex_(1) <callbacks_mutex_(2) <cluster_mutex_(3) <snapshot_mutex_(4) forRaftConsensusAdapter.logGroundingOperationnow usesstd::scoped_lockfor atomic dual acquisition;getMetricsno longer holdsmetrics_mutex_while calling intostate_mutex_-protected paths. - Verification: All lock hierarchies verified in place; scoped_lock patterns confirmed; deadlock-free
- Test evidence: LKO-01..LKO-06 in
tests/sharding/test_sharding_thread_safety_lock_order_focused.cpp
- Canonical order documented in headers:
- Phase C pre-requisite: consensus coordination robustness (170 gaps → 51) (delivered 2026-08-10, verified 2026-08-17)
- Fixes:
backgroundSyncThreadnow detects quorum loss (null consensus layers) and backs off; retry logic added for transientSTORAGE_AHEAD/CACHE_AHEADsync failures; atomic interval read prevents torn reads ofbackground_sync_interval_ms_. - Verification: Exception safety audit complete; all resource cleanup in exception paths verified
- Test evidence: CCR-01..CCR-06 in
tests/sharding/test_sharding_thread_safety_lock_order_focused.cpp
- Fixes:
- [~] Phase C ctest gate:
test_sharding_multishard_exactunder shard failure injection (explicitly registered asShardingMultiShardExactPhaseCGate; code audit and test infrastructure verified 2026-08-17; full environment validation pending — repo-wide build blockers resolved 2026-08-17) (Target: Q4 2026 validation) - [~] Phase C benchmark gate:
bench_multishard_exact(deterministic benchmark hygiene tightened; code audit verified 2026-08-17; full environment validation pending — repo-wide build blockers resolved 2026-08-17) (Target: Q4 2026 validation) - Phase C observability:
sharding_cross_shard_requests_totalPrometheus metric wired (Target: Q4 2026)
- tighten deterministic behavior under sustained shard migration and skewed load (Target: Q4 2026)
- expand stress coverage for cross-shard transaction and anti-entropy edge scenarios (Target: Q4 2026)
- improve operator-facing diagnostics for rebalance/repair incident triage (Target: Q4 2026)
- re-baseline p95/p99 envelopes for routing, commit, and migration-sensitive paths (Target: Q1 2027)
- broaden benchmark depth for advanced multi-DC and topology-failure scenarios (Target: Q1 2027)
- harden long-run reliability under sustained distributed write pressure (Target: Q1 2027)
These items are part of the next-phase Track 2: Distributed Systems Maturity plan
(see ROADMAP.md §Track 2). Hard gate per item: deterministic under-load benchmark + release_critical CI green.
- [~] Automatic shard rebalancing on topology change: when a node joins or leaves the cluster,
automatically redistribute shards to maintain target balance; rebalancing must complete within a
configurable time bound without halting query throughput (Target: Q3 2026) — basic rebalance framework exists in
src/sharding/rebalance_operation.cpp; topology-change automation remains unfinished- Inputs: topology change event, rebalance policy (min-movement / round-robin), target shard count
- Acceptance: rebalance completes at ≥ 80% throughput of steady-state; no data loss; CTest
release_criticalgreen
- Cross-datacenter latency-aware routing: route cross-shard reads to the replica with lowest
measured RTT in the requesting DC; fall back to nearest-replica on timeout (Target: Q3 2026)
- Clarification: no
src/sharding/*.cppimplementation evidence for latency-aware / multi-DC routing was found in this validation pass. - Acceptance: routing selects correct replica in 3-DC topology benchmark; p99 read latency improves vs. random routing; deterministic under-load benchmark result
- Clarification: no
- Global secondary indexes (GSI): maintain a distributed index over all shards for a user-specified
field; GSI updates are asynchronous and eventually consistent; index-backed range scan available in AQL (Target: Q4 2026)
- Clarification: no
src/sharding/*.cppimplementation evidence for GSI support was found in this validation pass. - Inputs:
CREATE INDEX … GLOBALDDL (via AQL DDL extension); field, type, consistency level - Acceptance: GSI scan returns correct results for 100K documents across 4 shards;
AQL
FILTER doc.field == @val USE INDEX gsi_nameselects GSI plan
- Clarification: no
- freeze routing/coordination/transaction contracts for current major line —
include/sharding/sharding_api_contract.h(§1 Routing, §2 2PC Transaction, §3 WAL Durability, §4 Migration/Rebalance, §6 Threading) (Target: Q3 2026) - define explicit error taxonomy for sharding failure classes —
include/sharding/sharding_api_contract.h§5 Error Taxonomy: 12+ codes (QUORUM_LOST, COORDINATOR_FAILURE, SHARD_UNAVAILABLE, MIGRATION_CONFLICT, WAL_CORRUPTION, CONSENSUS_TIMEOUT, etc.) (Target: Q3 2026)
- complete hardening for routing/coordinator and transaction internals (Target: Q4 2026)
- align repair/rebalance/migration behavior to bounded runtime contracts (Target: Q4 2026)
- standardize fail-safe behavior for quorum loss, migration faults, and repair failures (Target: Q4 2026)
- unify diagnostics across routing/transaction/operations incident classes (Target: Q4 2026)
- expand focused regressions for shard failure, transaction contention, and migration edge scenarios (P6-01: TXC-01..TXC-32 2PC/3PC consistency; P6-02: FLR-01..FLR-20 failover/recovery — in test_sharding_phase6_hardening.cpp; P6-03: FI-01..FI-40 Wave-8 fault injection — in test_sharding_p6_fault_injection.cpp; SCR-01..SCR-16 contract hardening — in
tests/sharding/test_sharding_contract_hardening_focused.cpp) (Target: Q4 2026 → delivered 2026-07-29) - extend deterministic stress fixtures for distributed load and topology churn (P6-01/P6-02/P6-03 seed-42 deterministic suites delivered; SCR-01..SCR-16 kShardContractSeed=42) (Target: Q4 2026 → delivered 2026-07-29)
- lock benchmark-backed release gates for sharding hot paths — 6 release-gate benchmarks SRG-01..SRG-06 in
benchmarks/sharding/bench_sharding_release_gates.cpp(GATE-SRG-01..GATE-SRG-06: consistent-hash routing, 2PC prepare/commit, WAL append, health check, route lookup) (Target: Q4 2026) - validate p95/p99 and throughput behavior against release baselines (Target: Q4 2026)
- core sharding module docs aligned to source-verifiable behavior —
include/sharding/sharding_api_contract.hfreezes all routing/2PC/WAL/migration contracts for v1.x - roadmap/future planning separated from historical changelog entries
- core sharding surfaces documented and source-verified
- module-level security and failure behavior documented
- benchmark mapping documented in performance expectations —
benchmarks/sharding/bench_sharding_release_gates.cpp(SRG-01..SRG-06) - remaining hardening tasks closed for failure/transaction/repair edge paths
- release benchmark stabilization complete
- runtime behavior depends on topology size, quorum profile, and migration pressure.
- selected failure and topology-churn edge scenarios need continued hardening.
- benchmark depth should continue expanding for advanced distributed workloads.
No breaking sharding contract planned. Any contract-breaking change requires migration notes and changelog entry before merge.
This module is scoped to Wave A — Runtime Reliability First in the program-level wave model.
See [[../../ROADMAP.md|ROADMAP]] for the full Wave A → B → C → D gate model and exit criteria.
- Sharding: complete multi-shard exact-path gate, topology-change auto-rebalance hardening, latency-aware routing, and long-run distributed write stress (Target: Q3–Q4 2026, technical closure complete 2026-08-17)
- Deterministic chaos evidence complete for recovery and failover paths (Target: Q4 2026, completed via TXC/FLR/FI/SCR release-critical suites)
- Fail-closed behavior verified for all distributed/acceleration paths in scope (Target: Q4 2026, completed via thread-safety/lock-order/recovery policy hardening)
-
release_criticalCI green ondevelop(Target: Q4 2026, Wave A gate integration + blocker remediation complete) - Representative-hardware p95/p99 baselines refreshed (Target: Q4 2026, SRG-01..06 baseline gates captured)
- Focused regression closure: TXC-01..32, FLR-01..20, FI-01..40, and SCR-01..16 suites are delivered and referenced in this roadmap.
- Chaos/fault-injection evidence: Wave-8 fault-injection coverage is delivered in
tests/sharding/test_sharding_p6_fault_injection.cppand integrated into the gate board. - Fail-closed verification: thread-safety and lock-order hardening plus multi-shard exact gate validation are complete (
MULTISHARD_GATE_VALIDATION_REPORT.md). - Representative-hardware p95/p99 baselines: Wave A baseline refresh completed with SRG-01..06 gates (
benchmarks/sharding/WAVE_A_BASELINE_REPORT.md). -
release_criticalcoverage: Wave A gate integration and blocker remediation complete for sharding closure (src/sharding/WAVE_A_CLOSURE_EVIDENCE_BUNDLE.md). - Next closure batch: completed 2026-08-17; technical closure evidence consolidated in
src/sharding/WAVE_A_CLOSURE_EVIDENCE_BUNDLE.md.
- Wave B performance consolidation depends on Wave A gate closure.
- Wave C security validation depends on stable Wave A runtime behavior.
- Wave D operability hardening depends on all prior waves being gate-complete.
- Architecture-ACCESS-MODEL-IMPLEMENTATION-SUMMARY
- Architecture-ADR-003-pg-dump-sql-parser
- Architecture-BASEENTITY-PRINCIPLE
- Architecture-CACHE-STORAGE-INTEGRATION
- Architecture-CMAKE-ARCHITECTURE
- Architecture-CMAKE-FLAGS-REFERENCE
- Architecture-CMAKE-MODULAR-ARCHITECTURE
- Architecture-CONCERNS-ARCHITECTURE-DIAGRAM
- Architecture-CONCERNS-IMPLEMENTATION-SUMMARY
- Architecture-CONTENT-MODEL
- Architecture-COPILOT-THEMISDB-GRAPH-RAG-BACKEND-ARCHITECTURE
- Architecture-CRYPTO-AND-KEYS
- Architecture-FEATURE-FLAGS-REFERENCE
- Architecture-GPU-ARCHITECTURE-REVIEW-TEMPLATE
- Architecture-HTTP-SHUTDOWN-HARDENING
- Architecture-MIGRATION-GUIDE-CONCERNS
- Architecture-MIGRATION-GUIDE-v13-v14
- Architecture-MODULARIZATION-GUIDE
- Architecture-MODULAR-ARCHITECTURE-ROADMAP
- Architecture-MODULE-ARCHITECTURE-INDEX
- Architecture-P1D01-ISSMPLUGIN-DESIGN-REVIEW
- Architecture-P1-D01-ISSMPLUGIN-DESIGN-REVIEW
- Architecture-P1-D08-MAMBA-GOVERNANCE-CONTRACT
- Architecture-P1-P2-IMPLEMENTATION-COMPLETION-INDEX
- Architecture-PHASE0-COMPLETION-ASSESSMENT
- Architecture-PHASE3-QUERYENGINE-DI-ARCHITECTURE
- Architecture-PHASE4-INDEX-MANAGER-DI
- Architecture-POSTGRESQL-WIRE-PROTOCOL
- Architecture-QUERYENGINE-IMPLEMENTATION-GUIDE
- Architecture-QUERY-SCHEDULING
- Architecture-RAFT-CONSENSUS-DESIGN
- Architecture-README
- Architecture-README-SSM-HYBRID-IMPLEMENTATION
- Architecture-REFACTORING-SUMMARY
- Architecture-RESOURCE-POOLING
- Architecture-SOURCE-DIRECTORY-GUIDE
- Architecture-THEMIS-CORE-GUIDE
- Architecture-UNIFIED-ACCESS-MODEL
- Architecture-WAL-GRPC-MTLS-CONFIGURATION
- Architecture-WIRE-PROTOCOL-RETRY
- Architecture-boltzmann-observability-draft
- Architecture-experimental-logarithmic-vector-storage
- Architecture-llm-wiki-mvp-adr
- Architecture-rewrite-engine-architecture
- Architecture-rope-api-architecture
- Architecture-ssm-gguf-mamba-status
- Architecture-ssm-hybrid-analysis
- Architecture-ssm-hybrid-rollout-plan
- Architecture-ssm-plugin-interface-design-review
- Architecture-transaction-coordinators
- Architecture-wiki-secondary-index
- Architecture-wire-protocol
- Governance-DISABLED-STUB-POLICY
- Governance-DOCS-PR-POLICY
- Governance-GA-PROMOTION-SIGN-OFF
- Governance-GITHUB-MILESTONES-SETUP
- Governance-MATURITY-CLAIM-VERIFICATION-CHECKLIST
- Governance-MATURITY-EVIDENCE-REGISTRY
- Governance-MERGE-GATE-BOT-CONFIG
- Governance-MERGE-GATE-STATUS-LIVE
- Governance-PHASE3-ENFORCEMENT-RUNBOOK
- Governance-PHASE-1-CLOSURE-REPORT
- Governance-PHASE-CLOSURE-POLICY
- Governance-PHASE-DEPENDENCY-GRAPH
- Governance-PLUGIN-SUBMODULE-ROLLBACK
- Governance-PRODUCTION-READY-2026-DELIVERY-PLAN
- Governance-PR-VERSION-TARGETING
- Governance-PR-VERSION-TARGETING-BACKFILL
- Governance-QUERY-MODULE-STATUS
- Governance-README
- Governance-RELEASE-PROMOTION-GATE-POLICY
- Governance-RELEASE-VALIDATION-CHECKLIST
- Governance-SECURITY-MODULE-5671-EVIDENCE-SUMMARY
- Governance-SHARDING-P6-RESIDUAL-RISK-ACCEPTANCE
- Governance-SOURCECODE-COMPLIANCE-GOVERNANCE
- Governance-UPDATES-DEVELOPMENT-STATUS-SIGN-OFF
- Governance-WAVE-C-IMPLEMENTATION-COMPLETE
- Module-acceleration-Roadmap
- Module-access-model-Roadmap
- Module-ai-Roadmap
- Module-analytics-Roadmap
- Module-api-Roadmap
- Module-aql-Roadmap
- Module-auth-Roadmap
- Module-base-Roadmap
- Module-cache-Roadmap
- Module-cdc-Roadmap
- Module-chaos-Roadmap
- Module-chimera-Roadmap
- Module-config-Roadmap
- Module-content-Roadmap
- Module-core-Roadmap
- Module-distributed-knowledge-Roadmap
- Module-distributed-tensor-Roadmap
- Module-document-Roadmap
- Module-ethics-ai-Roadmap
- Module-evaluation-Roadmap
- Module-execution-Roadmap
- Module-exporters-Roadmap
- Module-failover-Roadmap
- Module-geo-Roadmap
- Module-governance-Roadmap
- Module-gpu-Roadmap
- Module-graph-Roadmap
- Module-image-analysis-Roadmap
- Module-importers-Roadmap
- Module-index-Roadmap
- Module-ingestion-Roadmap
- Module-llama-cpp-Roadmap
- Module-llm-Roadmap
- Module-llm-streaming-Roadmap
- Module-llm-wiki-Roadmap
- Module-maintenance-Roadmap
- Module-metadata-Roadmap
- Module-network-Roadmap
- Module-observability-Roadmap
- Module-onnx-clip-Roadmap
- Module-performance-Roadmap
- Module-plugins-Roadmap
- Module-process-Roadmap
- Module-projects-Roadmap
- Module-prompt-engineering-Roadmap
- Module-query-Roadmap
- Module-rag-Roadmap
- Module-replication-Roadmap
- Module-retrieval-Roadmap
- Module-rpc-grpc-Roadmap
- Module-scheduler-Roadmap
- Module-scraper-Roadmap
- Module-search-Roadmap
- Module-security-Roadmap
- Module-server-Roadmap
- Module-sharding-Roadmap
- Module-stable-diffusion-Roadmap
- Module-storage-Roadmap
- Module-temporal-Roadmap
- Module-tensor-Roadmap
- Module-themis-Roadmap
- Module-timeseries-Roadmap
- Module-toolbox-Roadmap
- Module-training-Roadmap
- Module-transaction-Roadmap
- Module-updates-Roadmap
- Module-user-storage-encrypted-Roadmap
- Module-utils-Roadmap
- Module-vector-search-Roadmap
- Module-voice-Roadmap
- Module-whisper-Roadmap