Evgeny
466632e60a
db_sync: fix dh_match premature sync complete — send tail when mc > tp+1
...
Root cause: db_handle_init_resp marked sync_state=2 when my_dh==peer_dh
without checking that all my records fit in the confirmed prefix.
If mc > tp+1 (I have records beyond the common prefix), the tail was
never sent — lost records.
Fix:
- Remove special-case 'sc==0 && my_dh==peer_dh' (redundant, same bug)
- In general dh_match: if mc > tp+1, send remaining records [tp+1,mc-1]
using the same inline loop pattern as 'peer empty' branch
Test: 3 phases covering all dh_match paths:
- Phase 1: B empty+late instance → dh_match at tp=0 (sc=0) → tail-send 49
- Phase 2: A=80 B=50 → dh_match at tp=49 (sc>0, sparse) → tail-send 30
- Phase 3: fresh instances → peer empty → send all 30
2026-07-17 11:48:56 +03:00
..
2026-07-16 19:04:00 +03:00
2026-06-17 21:28:07 +03:00
2026-05-29 01:11:37 +03:00
2026-04-21 19:06:45 +03:00
2026-01-25 10:47:02 +03:00
2026-01-25 10:47:02 +03:00
2026-07-16 12:31:52 +03:00
2026-01-28 19:56:38 +03:00
2026-02-15 13:25:05 +03:00
2026-07-16 19:04:00 +03:00
2026-07-16 19:13:05 +03:00
2026-07-16 12:45:28 +03:00
2026-06-17 21:28:07 +03:00
2026-07-16 19:04:00 +03:00
2026-01-26 18:14:04 +03:00
2026-07-17 11:48:56 +03:00
2026-02-02 10:57:36 +03:00
2026-05-12 13:42:16 +03:00
2026-01-26 18:14:04 +03:00
2026-07-15 19:56:47 +03:00
2026-07-15 19:56:47 +03:00
2026-06-03 02:06:09 +03:00
2026-07-15 19:56:47 +03:00
2026-07-16 19:04:00 +03:00
2026-05-10 19:03:42 +03:00
2026-07-15 19:56:47 +03:00
2026-03-06 01:36:57 +03:00
2026-01-26 17:52:50 +03:00
2026-07-15 19:56:47 +03:00
2026-07-15 19:56:47 +03:00
2026-07-15 19:56:47 +03:00
2026-07-16 19:04:00 +03:00
2026-07-09 19:50:17 +03:00
2026-07-16 19:04:00 +03:00
2026-07-15 19:56:47 +03:00
2026-06-18 22:11:25 +03:00
2026-07-15 19:56:47 +03:00
2026-07-16 19:04:00 +03:00
2026-06-09 22:20:25 +03:00
2026-07-16 19:04:00 +03:00
2026-06-09 22:20:25 +03:00
2026-07-16 19:04:00 +03:00
2026-07-14 09:07:03 +03:00
2026-06-02 21:05:06 +03:00
2026-07-16 19:04:00 +03:00
2026-05-10 00:49:46 +03:00
2026-05-10 00:49:46 +03:00
2026-07-16 19:04:00 +03:00
2026-03-06 01:36:57 +03:00
2026-01-26 18:25:48 +03:00
2026-07-15 19:56:47 +03:00
2026-06-09 22:20:25 +03:00
2026-05-10 00:34:28 +03:00
2026-07-09 17:01:56 +03:00
2026-07-09 18:08:49 +03:00
2026-07-16 19:04:00 +03:00
2026-04-14 02:03:59 +03:00
2026-07-16 19:04:00 +03:00
2026-06-18 22:11:25 +03:00
2026-07-15 19:56:47 +03:00
2026-07-16 19:04:00 +03:00
2026-06-14 10:00:02 +03:00
2026-06-22 15:53:24 +03:00
2026-07-05 20:57:44 +03:00
2026-07-01 20:33:11 +03:00
2026-07-15 19:56:47 +03:00
2026-07-05 20:57:44 +03:00
2026-06-03 16:24:46 +03:00
2026-04-26 00:17:32 +03:00
2026-05-13 12:38:20 +03:00
2026-07-16 19:22:06 +03:00
2026-07-16 19:04:00 +03:00
2026-02-15 04:24:46 +03:00
2026-01-28 19:56:38 +03:00
2026-01-26 17:52:50 +03:00