7 mēneši atpakaļ | 236 revīzijas atzarā main kopš šī laidiena
Replication was structurally working but silently dropping all user content on every replicated document. Structure survived (_id, _version, timestamps), but the actual data fields were lost. Pre-existing bug from 2026-02-05, unrelated to v1.7.0's eviction work — surfaced by the replication sanity load test added in v1.7.0's follow-up (tests/load_test/run_replication_test.sh).
If you have replication.enabled: false (the default), you're unaffected. If you've turned replication on in any deployment, upgrade to v1.7.1.
| Side | Code | Behavior |
|---|---|---|
Leader database_service.cpp:515 |
entry.set_data(doc->data.dump()) |
Broadcasts only the user's JSON payload |
Follower database_service.cpp:612 |
Document doc = Document::fromJson(json) |
Expects full envelope (id, collection, data, version, timestamps) |
Document::fromJson reads j.value("data", {}). When the follower saw {seq: 123, content: "hello"} it looked for a "data" field inside that object, found nothing, and produced a Document with empty data. The replicated doc had the right ID and version metadata but zero user content.
One-line leader-side change: send doc->toJson() instead of doc->data.dump(). The follower's existing Document::fromJson() call then works correctly.
- if (doc) entry.set_data(doc->data.dump());
+ if (doc) entry.set_data(doc->toJson().dump());
Follower code unchanged. The ReplicationEntry proto fields (document_id, collection, document_version) stay — they're now slightly redundant with what's in the envelope but still serve as out-of-band routing breadcrumbs.
Using tests/load_test/run_replication_test.sh:
Before fix (v1.7.0):
Inserted on leader: 1000
Seen on follower: 1000
Content matches: 0
Content mismatches: 1000
Verdict: FAIL
After fix (v1.7.1):
Inserted on leader: 1000/1000
Seen on follower: 1000
Content matches: 1000
Content mismatches: 0
Catch-up time: 366ms
Verdict: PASS — all 1000 docs replicated in 366ms, zero corruption
git blame puts the bug at commit a96c168 on 2026-02-05, ~2.5 months before this release. It has been silently broken since then. Nobody noticed because replication has been opt-in and most deployments run single-node.
ReplicationEntry.data payload format changed from "raw user JSON" to "full Document envelope JSON". A v1.7.0 follower talking to a v1.7.1 leader won't understand the new format (will try to parse envelope as user data). Upgrade leaders and followers together.Four .deb packages published to repository.smartbotics.ai (suite: trixie):
smartbotic-database_1.7.1-1_amd64.deblibsmartbotic-db-client_1.7.1-1_amd64.deblibsmartbotic-db-client-dev_1.7.1-1_amd64.debsmartbotic-db-cli_1.7.1-1_amd64.deb