This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
new 3320ae4ef1 [fix](publish) add retry publish when succeed replica num
less than quorum and transaction not VISIBLE (#17453)
3320ae4ef1 is described below
commit 3320ae4ef17a1d88f23bb9fbfccf6b2edac2c378
Author: xueweizhang <[email protected]>
AuthorDate: Fri Mar 10 12:02:15 2023 +0800
[fix](publish) add retry publish when succeed replica num less than quorum
and transaction not VISIBLE (#17453)
for some reasons, transaction pushlish succeed replica num less than quorum,
this transaction's status can not to be VISIBLE, and this publish task of
this
replica of this tablet on this backend need retry publish success to
make transaction VISIBLE when last publish failed.
Signed-off-by: nextdreamblue <[email protected]>
---
.../apache/doris/catalog/TabletInvertedIndex.java | 43 ++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java
b/fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java
index 73fff8fd70..ff92c84801 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java
@@ -19,6 +19,7 @@ package org.apache.doris.catalog;
import org.apache.doris.catalog.Replica.ReplicaState;
import org.apache.doris.common.Config;
+import org.apache.doris.task.PublishVersionTask;
import org.apache.doris.thrift.TPartitionVersionInfo;
import org.apache.doris.thrift.TStorageMedium;
import org.apache.doris.thrift.TTablet;
@@ -237,6 +238,48 @@ public class TabletInvertedIndex {
map.put(transactionId,
versionInfo);
}
}
+ } else if
(transactionState.getTransactionStatus() == TransactionStatus.COMMITTED) {
+ // for some reasons, transaction
pushlish succeed replica num less than quorum,
+ // this transaction's status can not
to be VISIBLE, and this publish task of
+ // this replica of this tablet on this
backend need retry publish success to
+ // make transaction VISIBLE when last
publish failed.
+ Map<Long, PublishVersionTask>
publishVersionTask =
+
transactionState.getPublishVersionTasks();
+ PublishVersionTask task =
publishVersionTask.get(backendId);
+ if (task != null && task.isFinished())
{
+ List<Long> errorTablets =
task.getErrorTablets();
+ if (errorTablets != null) {
+ for (int i = 0; i <
errorTablets.size(); i++) {
+ if (tabletId ==
errorTablets.get(i)) {
+ TableCommitInfo
tableCommitInfo
+ =
transactionState.getTableCommitInfo(
+
tabletMeta.getTableId());
+ PartitionCommitInfo
partitionCommitInfo =
+
tableCommitInfo == null ? null :
+
tableCommitInfo.getPartitionCommitInfo(partitionId);
+ if
(partitionCommitInfo != null) {
+
TPartitionVersionInfo versionInfo
+ = new
TPartitionVersionInfo(
+
tabletMeta.getPartitionId(),
+
partitionCommitInfo.getVersion(), 0);
+ synchronized
(transactionsToPublish) {
+
ListMultimap<Long, TPartitionVersionInfo> map
+ =
transactionsToPublish.get(
+
transactionState.getDbId());
+ if (map ==
null) {
+ map =
ArrayListMultimap.create();
+
transactionsToPublish.put(
+
transactionState.getDbId(), map);
+ }
+
map.put(transactionId, versionInfo);
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+
}
}
} // end for txn id
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]