Imported from bare git on Zurich
Go to file
James 7fca22b130 Replication v2: Active-Passive with Async Sync (Commercial Only)
Implements Johan's design:
- Primary POP (e.g., Calgary) replicates writes to Backup POP (e.g., Zurich)
- Backup serves READ-ONLY traffic when primary fails
- Same wire format preserved for replication
- Async, non-blocking replication with queue + retry

Database Schema:
- Added replication_dirty BOOLEAN column to entries table
- Index idx_entries_dirty for fast dirty entry lookup
- EntryMarkDirty() - mark entry needing replication
- EntryMarkReplicated() - clear dirty flag on ACK
- EntryListDirty() - get pending entries (fast path)

Commercial-Only Files:
- edition/replication.go - core replication queue/worker
- edition/backup_mode.go - backup mode detection, write rejection
- edition/commercial.go - wire up IsBackupMode, IsBackupRequest

Backup Mode:
- CLAVITOR_BACKUP_MODE env var sets backup mode
- BackupModeMiddleware rejects writes with 503
- X-Primary-Location header tells client where primary is
- IsBackupMode() and IsBackupRequest() edition functions

Community:
- No replication functionality (privacy-first, single-node)
- IsBackupMode() always returns false
- StartReplication() is no-op

Documentation:
- SPEC-replication.md - full design specification
2026-04-02 00:50:20 -04:00
clavis Replication v2: Active-Passive with Async Sync (Commercial Only) 2026-04-02 00:50:20 -04:00
clavitor.ai Replication v2: Active-Passive with Async Sync (Commercial Only) 2026-04-02 00:50:20 -04:00
design-system chore: auto-commit uncommitted changes 2026-03-24 06:02:53 -04:00
docs docs: add Futurepedia listing content for clavitor.ai (TASK-074) 2026-03-29 07:36:12 -04:00
marketing chore: auto-commit uncommitted changes 2026-03-24 06:02:53 -04:00
operations Replication v2: Active-Passive with Async Sync (Commercial Only) 2026-04-02 00:50:20 -04:00
.DS_Store chore: auto-commit uncommitted changes 2026-03-27 00:01:22 -04:00
._.DS_Store chore: auto-commit uncommitted changes 2026-03-24 06:02:53 -04:00
CLAUDE.md chore: auto-commit uncommitted changes 2026-03-26 06:03:15 -04:00