After synchronization is complete we should make primary counters be
equal to secondary counters: primary_localcnt = secondary_remotecnt primary_remotecnt = secondary_localcnt Previously it was done wrong and split-brain was observed after primary had synchronized up-to-date data from secondary. Approved by: pjd (mentor) MFC after: 1 week
This commit is contained in:
parent
999d680c92
commit
9237aa3fa5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219882
@ -1757,13 +1757,13 @@ sync_thread(void *arg __unused)
|
|||||||
mtx_lock(&metadata_lock);
|
mtx_lock(&metadata_lock);
|
||||||
res->hr_syncsrc = HAST_SYNCSRC_UNDEF;
|
res->hr_syncsrc = HAST_SYNCSRC_UNDEF;
|
||||||
res->hr_primary_localcnt =
|
res->hr_primary_localcnt =
|
||||||
res->hr_secondary_localcnt;
|
|
||||||
res->hr_primary_remotecnt =
|
|
||||||
res->hr_secondary_remotecnt;
|
res->hr_secondary_remotecnt;
|
||||||
|
res->hr_primary_remotecnt =
|
||||||
|
res->hr_secondary_localcnt;
|
||||||
pjdlog_debug(1,
|
pjdlog_debug(1,
|
||||||
"Setting localcnt to %ju and remotecnt to %ju.",
|
"Setting localcnt to %ju and remotecnt to %ju.",
|
||||||
(uintmax_t)res->hr_primary_localcnt,
|
(uintmax_t)res->hr_primary_localcnt,
|
||||||
(uintmax_t)res->hr_secondary_localcnt);
|
(uintmax_t)res->hr_primary_remotecnt);
|
||||||
(void)metadata_write(res);
|
(void)metadata_write(res);
|
||||||
mtx_unlock(&metadata_lock);
|
mtx_unlock(&metadata_lock);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user