fix bug-1060 bug-1067
This commit is contained in:
parent
6067ba6c94
commit
61e1391cd0
28 changed files with 7021 additions and 2926 deletions
|
|
@ -486,6 +486,11 @@ static void wal_entry_to_wire(struct capn_segment *cs,
|
|||
w->prevLogIndex = e->prev_log_index;
|
||||
w->prevLogTerm = e->prev_log_term;
|
||||
w->leaderCommit = e->leader_commit;
|
||||
/* bug-1067: carry the streaming leader's CURRENT term per sub-entry (distinct
|
||||
* from `term` above, the entry's stored term). The standby intake uses this as
|
||||
* the AppendEntries header term so historical (entry_term < leader_term)
|
||||
* catch-up entries are not stale-rejected. */
|
||||
w->leaderCurrentTerm = e->leader_current_term;
|
||||
if (e->raw_payload && e->raw_payload_len > 0) {
|
||||
capn_list8 pl = capn_new_list8(cs, (int)e->raw_payload_len);
|
||||
capn_setv8(pl, 0, e->raw_payload, (int)e->raw_payload_len);
|
||||
|
|
@ -539,6 +544,9 @@ int xce_wal_batch_encode_raw(wal_catchup_entry_t **entries, int n_entries,
|
|||
top.prevLogIndex = entries[0]->prev_log_index;
|
||||
top.prevLogTerm = entries[0]->prev_log_term;
|
||||
top.leaderCommit = entries[0]->leader_commit;
|
||||
/* bug-1067: the AppendEntries header term (leader's CURRENT term), distinct
|
||||
* from top.term (entries[0]'s stored term). Mirrors the per-entry field. */
|
||||
top.leaderCurrentTerm = entries[0]->leader_current_term;
|
||||
|
||||
/* Batch container: entries list carries the per-entry payload(s) (empty for
|
||||
* a heartbeat). Each sub-entry carries lsn/entryType/term/payload. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue