Skip to content

Commit

Permalink
[Enhancement] When the server machine is not recovered, make transact…
Browse files Browse the repository at this point in the history
…ion to complete in time.
  • Loading branch information
zhangheihei committed Aug 2, 2024
1 parent bf401b0 commit cae05c0
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,17 @@ public boolean canTxnFinished(TransactionState txn, Set<Long> errReplicas, Set<L
int successHealthyReplicaNum = 0;
// if most replica's version have been updated to version published
// which means publish version task finished in replica
for (Replica replica : ((LocalTablet) tablet).getImmutableReplicas()) {
for (Replica replica : ((LocalTablet) tablet).getAllReplicas()) {
// Using getAllReplicas() instead of getImmutableReplicas
// In order for the transaction to complete in time for this scenario: the server machine is not recovered.
// 1. Transaction TA writes to a two-replicas tablet and enters the committed state.
// The tablet's repliace are replicaA, replicaB.
// 2. replicaA, replicaB generate tasks: PublishVersionTaskA, PublishVersionTaskB.
// PublishVersionTaskA/PublishVersionTaskB successfully submitted to the beA/beB via RPC.
// 3. The machine where beB is located hangs and is not recoverable.
// Therefore PublishVersionTaskA is finished,PublishVersionTaskB is unfinished.
// 4. FE clone replicaC from replicaA, BE report replicaC info.
// However, the update of immutableReplicas must wait for the checkpoint
if (!errReplicas.contains(replica.getId())) {
// success healthy replica condition:
// 1. version is equal to partition's visible version
Expand Down

0 comments on commit cae05c0

Please sign in to comment.