[Tarantool-patches] [PATCH v4 07/12] raft: filter rows based on known peer terms

Serge Petrenko sergepetrenko at tarantool.org
Tue Apr 20 23:55:21 MSK 2021



20.04.2021 23:31, Serge Petrenko via Tarantool-patches пишет:
>
>
> 20.04.2021 23:29, Serge Petrenko via Tarantool-patches пишет:
>>
>>
>> 16.04.2021 19:25, Serge Petrenko пишет:
>>> Start writing the actual leader term together with the PROMOTE request
>>> and process terms in PROMOTE requests on receiver side.
>>>
>>> Make applier only apply synchronous transactions from the instance 
>>> which
>>> has the greatest term as received in PROMOTE requests.
>>>
>>> Closes #5445
>>>
>>
>> A couple of fixes on top:
>> Only apply  PROMOTE when it's for a greater term than already received.
>> If promote tries to confirm entries for instance id other than 
>> limbo->owner_id
>> rollback everything that's unconfirmed.
>
> Sorry, discard this. election_qsync_stress hangs again with this change.
>
> I haven't pushed it yet anyway.
>
This part of change is good. I applied it and pushed the branch:

==============================

diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c
index 14e87cd3d..ad5093750 100644
--- a/src/box/txn_limbo.c
+++ b/src/box/txn_limbo.c
@@ -649,8 +649,14 @@ txn_limbo_process(struct txn_limbo *limbo, const 
struct synchro_request *req)
         uint32_t origin = req->origin_id;
         if (txn_limbo_replica_term(limbo, origin) < term) {
                 vclock_follow(&limbo->promote_term_map, origin, term);
-               if (term > limbo->promote_greatest_term)
+               if (term > limbo->promote_greatest_term) {
                         limbo->promote_greatest_term = term;
+               } else if (req->type == IPROTO_PROMOTE) {
+                       /*
+                        * PROMOTE for outdated term. Ignore.
+                        */
+                       return;
+               }
         }
         if (req->replica_id == REPLICA_ID_NIL) {
                 /*

===============================

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list