Refactor Merkle sync into bounded bidirectional rounds with atomic member updates

This commit is contained in:
evgeny committed 2026-09-27 14:44:39 +03:00
1 parent 1b92b4885b
commit 3e25bcef02
21 files changed
+1550 -1859

No files matched your search

+8
View File
@@ -556,10 +556,18 @@ static int child_main(const char* role, const char* dir, int invalid_key) {
if (!wait_join_result(inst, 8000)) {
fprintf(stderr, "J: no JOIN_READY\n"); goto out;
}
char ready[512]; snprintf(ready, sizeof(ready), "%s/join_ready", dir);
wf(ready, "ready");
rc = 0;
}
}
/* Локальная запись не означает доставку: участники обслуживают обмен до JOIN_READY у J. */
if (rc == 0 && !invalid_key && strcmp(role, "j") != 0) {
char ready[512]; snprintf(ready, sizeof(ready), "%s/join_ready", dir);
if (!wait_file(inst, ready, 8000)) { fprintf(stderr, "%s: join delivery not confirmed\n", role); rc = 1; }
}
out:
if (early_link || delayed_registration) rc = 1;
fprintf(stderr, "%s: %s\n", role, rc == 0 ? "OK" : "FAIL");