Commit Graph

311 Commits

Author SHA1 Message Date
dimgigov a843f0a1a3 fix(raft): gate snapshot build/restore, repoint http ctx, pre-tag docs
CI / test (push) Has been cancelled
CI / raft-e2e (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
v1.3.0
2026-07-31 04:46:05 +03:00
dimgigov dac92d1741 release: prepare v1.3.0 changelog and version bump 2026-07-31 04:16:11 +03:00
dimgigov d303cc5658 docs: v1.3.0 raft-supported docs, limitations, runbook updates 2026-07-31 04:16:11 +03:00
dimgigov ad90ebcd5e test(raft): cold-node rejoin and wiped-node join e2e
Includes two raft fixes the e2e exposed:
- heartbeatLoop drops cached peer sockets on leadership acquisition
  (half-dead sockets to a restarted peer never errored, so no redial
  ever happened and the cluster livelocked without heartbeats)
- restoreSnapshot repoints tcpServer ctx/db at the reopened database
  (queries kept reading the closed pre-restore LSM, serving 0 rows)
2026-07-31 03:53:48 +03:00
dimgigov 9ff9c2f6be feat(raft): compaction unpinned from stale peers (snapshot fallback) 2026-07-31 03:12:06 +03:00
dimgigov c94bac43e5 fix(raft): ignore intermediate InstallSnapshot chunk replies 2026-07-31 03:02:32 +03:00
dimgigov 862d62590e feat(raft): leader InstallSnapshot send on unrecoverable lag 2026-07-31 02:53:30 +03:00
dimgigov efa04e4b36 feat(raft): follower InstallSnapshot receive and restore 2026-07-31 02:33:32 +03:00
dimgigov cb9cd7415d feat(raft): InstallSnapshot wire protocol (backward-compatible) 2026-07-31 02:12:51 +03:00
dimgigov f416fe930e test(raft): wire-level TLS handshake assertion in tls e2e 2026-07-31 02:05:43 +03:00
dimgigov f2b7ed1ce2 test(raft): 3-node TLS cluster e2e with plaintext rejection 2026-07-31 01:55:43 +03:00
dimgigov 2f30a59216 feat(raft): TLS on follower→leader SQL forwarding 2026-07-31 01:45:59 +03:00
dimgigov ed89c88afa feat(raft): optional TLS on raft transport (server + dialer) 2026-07-31 01:31:20 +03:00
dimgigov 8d083f5fdc feat(raft): TLS config surface with fail-closed startup 2026-07-31 01:14:20 +03:00
dimgigov efa46b05c6 ci(raft): dedicated mandatory raft e2e job; no silent skips under CI 2026-07-31 01:07:11 +03:00
dimgigov 431334b70a fix(raft): distinguish put-with-empty-value from delete in write path 2026-07-31 00:58:51 +03:00
dimgigov 63cb05afe2 test(raft): failover under sustained write load e2e 2026-07-31 00:35:55 +03:00
dimgigov 09f462f467 release: v1.2.0 Production GA (single-node)
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- known-limitations, deployment runbook, release checklist
- prod compose requires JWT secret; BARADB_ENV=production fail-closed
- scripts/backup-restore-drill.sh (backup → wipe → restore → verify)
- version bump 1.2.0 (nimble, Dockerfile, health, CHANGELOG dated)
v1.2.0
2026-07-30 21:52:21 +03:00
dimgigov c66276d72a docs: production GA v1.2.0 plan (single-node cut line)
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Define production as tagged release + auth prod compose + backup/restore
drill + runbook + known limitations. Raft multi-node stays experimental.
Task plan for agentic execution in docs/superpowers/plans/.
2026-07-30 21:45:16 +03:00
dimgigov 16ec8b5dc4 docs: raft cluster status, plans closed, CHANGELOG/README/monitoring
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
- Add raft-cluster-status overview (C3a/C3b/post-C3b shipped on main)
- Mark C3a/C3b design+plans done; refresh operator docs en/bg
- CHANGELOG 1.2.0 Raft section; README cluster example and status line
- monitoring.md health/metrics match real HTTP port+440 and raft series
2026-07-30 21:41:15 +03:00
dimgigov 1b3c26123a feat(raft): expose raft metrics on /metrics and /health
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- RaftMetrics counters: elections, term changes, appends, commit waits/ms,
  timeouts, lost leadership, forwards, applies, compactions
- Gauges via prometheusText: is_leader, term, log size, commit/applied,
  apply lag, snapshot index
- Wire httpServer.raftNode; extend GET /metrics and GET /health
2026-07-30 21:38:44 +03:00
dimgigov 53704e1036 feat(raft): safe log compaction with snapshot metadata
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- lastSnapshotIndex/Term bound the compacted prefix; lastLogIndex/Term
  and AppendEntries prevLog checks respect the snapshot base
- compactLog drops entries only through min(matchIndex, lastApplied) on
  the leader so lagging peers can still catch up via AppendEntries
- Persist snapshot fields in raft_state.bin; BARADB_RAFT_LOG_MAX_ENTRIES
- Fix commit-index scan to use findLogEntryByIndex (works after compact)
2026-07-30 21:35:41 +03:00
dimgigov 9df8316305 feat(raft): transparent leader write/DDL forwarding
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- BARADB_RAFT_CLIENT_PEERS maps node id → SQL client host:port
- Followers proxy DML/DDL to the known leader over the wire protocol
  (falls back to "not leader" when the map is missing)
- E2E: follower CREATE/INSERT succeed via forward; docs updated
2026-07-30 21:31:05 +03:00
dimgigov 095698ba82 feat(raft): replicate schema DDL through the raft log
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- isRaftDdl + leader-only gate for CREATE/DROP/ALTER (not DATABASE)
- appendDdlToRaft ships original SQL; applyCommand re-executes via
  applyReplicatedDdl (idempotent on leader double-apply)
- Mixed DDL+DML batches use the DDL path so order is preserved
- Fix secondary-index point lookup to use entry.lsmKey (not filter col)
- E2E: CREATE only on leader, schema + index SELECT on follower
2026-07-30 21:25:58 +03:00
dimgigov 50f827f8cf fix(raft): graph apply + reject non-default DB writes
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- applyReplicatedPut/Delete keep in-memory graphs in sync with node/edge
  table rows (idempotent edges via addEdgeWithIdIfAbsent).
- When Raft is enabled, DML is refused on any database other than
  'default' (the only DB the state machine is wired to).
- Docs updated (en/bg); unit test for graph apply.
2026-07-30 21:19:01 +03:00
dimgigov 0d51497f57 fix(raft): multi-stmt write gate, rich apply, delete kv convention
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
- Reject follower writes if any statement in the batch is DML/COMMIT
  (not only stmts[0]).
- COMMIT always emits empty-valued kvPairs for isDelete entries.
- applyCommand updates LSM plus secondary B-tree/FTS/HNSW indexes
  (applyReplicatedPut/Delete) so follower index scans see replicated rows.
- Tests: not-leader append, commit timeout, index apply unit, E2E
  index-backed SELECT on follower.
2026-07-30 21:14:46 +03:00
dimgigov a462d21b25 docs: SQL writes through raft (C3b) done
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
Mark the C3b design done; document leader-only DML, env vars, and default-DB
apply limits in en/bg distributed docs; refresh the README raft status line.
2026-07-30 21:07:14 +03:00
dimgigov 44060701b7 test(raft): E2E replicated writes; wire SQL path to raft node
- Fix runTcpServer to run the already-wired Server (raftNode was assigned
  on a different instance that never accepted clients).
- Cap raft peer connect at 200ms and fan out heartbeats in parallel so a
  dead peer cannot stall AppendEntries to the live majority.
- Add raft_writes_e2e_test: 3-node write replication, follower rejection,
  and post-failover writes; wire into nimble test + gitignore.
2026-07-30 21:06:49 +03:00
dimgigov 333941ab65 feat(raft): leader appends writes to raft log and waits for commit 2026-07-30 19:36:16 +03:00
dimgigov 38c1c01841 feat(raft): classify writes, reject them on follower nodes 2026-07-30 19:07:58 +03:00
dimgigov 8a35a838d0 docs: SQL writes through raft (C3b) spec + plan 2026-07-30 18:58:47 +03:00
dimgigov f9cc68d4e6 chore(raft): ignore e2e test binary, stop raft network on shutdown
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-07-30 18:46:09 +03:00
dimgigov b6eccf284e test(raft): end-to-end 3-node cluster election and failover 2026-07-30 18:35:18 +03:00
dimgigov f01586354a fix(raft): partial-read-safe frame reassembly 2026-07-30 18:01:53 +03:00
dimgigov 3f8537eaad feat(raft): run election timer in production, reset on AppendEntries 2026-07-30 17:47:05 +03:00
dimgigov 853ec7dd3b feat(raft): parse id@host:port peers, enable raft state persistence 2026-07-30 17:34:39 +03:00
dimgigov b5f9c1e798 docs: networked Raft bootstrap (C3a) spec + plan 2026-07-30 17:29:28 +03:00
dimgigov e8f9cbc5bb fix: CREATE UNIQUE INDEX actually enforces uniqueness (and persists)
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-07-30 17:13:29 +03:00
dimgigov 5858a9da17 docs: UNIQUE index enforcement plan 2026-07-30 16:59:26 +03:00
dimgigov 8d2d97ad94 feat(persist): standalone B-tree indexes survive restart
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-07-30 16:53:25 +03:00
dimgigov fcb6237caf docs: B-tree index persistence plan 2026-07-30 16:46:04 +03:00
dimgigov 8df0e02d3f docs: engine persistence (C1) done
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-07-30 16:36:49 +03:00
dimgigov 821b668d87 fix(persist): unnamed FTS/HNSW indexes survive restart (nameless replay DDL) 2026-07-30 16:27:36 +03:00
dimgigov 214b9cf346 fix: DROP INDEX/TABLE clean up FTS/HNSW indexes and their schema keys 2026-07-30 16:20:23 +03:00
dimgigov ce6e7aa707 feat(persist): graphs survive restart (rebuild from backing tables) 2026-07-30 16:11:52 +03:00
dimgigov 214e44abd7 feat(persist): HNSW vector indexes survive restart 2026-07-30 16:05:25 +03:00
dimgigov 6703ca2b29 feat(persist): FTS indexes survive restart (schema key + restore replay) 2026-07-30 15:56:48 +03:00
dimgigov 9088dc1381 docs: engine persistence (C1) spec + implementation plan 2026-07-30 15:47:03 +03:00
dimgigov ba7cf195c6 chore: stop tracking compiled test binaries (bugfix_test, nimforum_smoke_test)
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
2026-07-30 15:36:41 +03:00
dimgigov 62504aa348 docs(exec): document module layering after executor split
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
2026-07-30 15:17:31 +03:00