Log history pause and await verified roots in empty peer fixtures

This commit is contained in:
evgeny committed 2026-10-26 18:27:26 +01:00
1 parent d76eb067bb
commit 3fe697e1a9
2 files changed
+12 -3

No files matched your search

+2
View File
@@ -1112,6 +1112,8 @@ void db_sync_peer_set_paused(struct DB_SYNC_INSTANCE* si, uint64_t peer, int pau
struct SI_PEER* p = si ? si_peer_add(si, peer) : NULL;
if (!p) return;
p->paused = !!paused; p->sync_state = 0;
DEBUG_INFO(DEBUG_CATEGORY_CHAT_SYNC, "history peer pause tbl=%s peer=%016llx paused=%u",
SI_TBL(si), (unsigned long long)peer, p->paused);
if (paused) merkle_sync_cancel(si->db_sync->inst, MT_DATA_MESSAGES, peer, si->ns);
else db_start_peer(si, peer);
}
+10 -3
View File
@@ -62,6 +62,7 @@ static char temp_dir[] = "/tmp/utun_dbsync_XXXXXX";
static char config_a[256], config_b[256], config_c[256];
static uint32_t ca_target, cb_target, cc_target;
static uint64_t delivery_timestamp;
static int history_ready(struct DB_SYNC_INSTANCE* si);
/* Оба сообщения одного автора в одной ms получают отдельные реальные ACK. */
static int cond_delivery(void) {
@@ -185,9 +186,15 @@ static int _cond_cb(void) { return g_done_b && si_b && db_sync_count(si_b) == cb
static int _cond_cc(void) { return g_done_c && si_c && db_sync_count(si_c) == cc_target; }
static int _cond_both(void) { return _cond_ca() && _cond_cb(); }
static int _cond_all(void) { return _cond_ca() && _cond_cb() && _cond_cc(); }
static int _cond_cb_count(void) { return si_b && db_sync_count(si_b) == cb_target; }
static int _cond_both_count(void) { return si_a && db_sync_count(si_a) == ca_target && si_b && db_sync_count(si_b) == cb_target; }
static int _cond_all_count(void) { return si_a && db_sync_count(si_a) == ca_target && si_b && db_sync_count(si_b) == cb_target && si_c && db_sync_count(si_c) == cc_target; }
static int _cond_cb_count(void) { return si_b && !history_ready(si_b) && db_sync_count(si_b) == cb_target; }
static int _cond_both_count(void) {
return si_a && si_b && !history_ready(si_a) && !history_ready(si_b) &&
db_sync_count(si_a) == ca_target && db_sync_count(si_b) == cb_target;
}
static int _cond_all_count(void) {
return si_a && si_b && si_c && !history_ready(si_a) && !history_ready(si_b) && !history_ready(si_c) &&
db_sync_count(si_a) == ca_target && db_sync_count(si_b) == cb_target && db_sync_count(si_c) == cc_target;
}
static int insert_many(struct DB_SYNC_INSTANCE* si, struct UTUN_INSTANCE* inst, int start, int count) {
char buf[128];