This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 49fecd2a6d [improvement](log) print info of error replicas (#14220)
49fecd2a6d is described below
commit 49fecd2a6dae2a6327490301525911d07b519018
Author: Yongqiang YANG <[email protected]>
AuthorDate: Mon Nov 14 11:37:18 2022 +0800
[improvement](log) print info of error replicas (#14220)
---
.../doris/transaction/DatabaseTransactionMgr.java | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
index a4fd6a25dc..d78a6d7b95 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
@@ -417,7 +417,8 @@ public class DatabaseTransactionMgr {
private void checkCommitStatus(List<Table> tableList, TransactionState
transactionState,
List<TabletCommitInfo> tabletCommitInfos,
TxnCommitAttachment txnCommitAttachment,
Set<Long> errorReplicaIds, Map<Long,
Set<Long>> tableToPartition,
- Set<Long> totalInvolvedBackends) throws
UserException {
+ Set<Long> totalInvolvedBackends) throws
UserException {
+
Database db = env.getInternalCatalog().getDbOrMetaException(dbId);
// update transaction state extra if exists
@@ -525,6 +526,7 @@ public class DatabaseTransactionMgr {
// save the error replica ids for current tablet
// this param is used for log
Set<Long> errorBackendIdsForTablet = Sets.newHashSet();
+ String errorReplicaInfo = new String();
for (long tabletBackend : tabletBackends) {
Replica replica =
tabletInvertedIndex.getReplica(tabletId, tabletBackend);
if (replica == null) {
@@ -541,21 +543,28 @@ public class DatabaseTransactionMgr {
// for example, a replica is in clone state
if (replica.getLastFailedVersion() < 0) {
++successReplicaNum;
+ } else {
+ errorReplicaInfo += " replica [" +
replica.getId() + "], lastFailedVersion ["
+ +
replica.getLastFailedVersion() + "]";
}
} else {
errorBackendIdsForTablet.add(tabletBackend);
errorReplicaIds.add(replica.getId());
// not remove rollup task here, because the
commit maybe failed
// remove rollup task when commit successfully
+ errorReplicaInfo += " replica [" +
replica.getId() + "] commitBackends null or "
+ + "tabletBackend [" +
tabletBackend + "] does not "
+ + "in commitBackends";
}
}
if (successReplicaNum < quorumReplicaNum) {
LOG.warn("Failed to commit txn [{}]. "
+ "Tablet [{}] success replica num
is {} < quorum replica num {} "
- + "while error backends {}",
transactionState.getTransactionId(),
- tablet.getId(), successReplicaNum,
quorumReplicaNum,
-
Joiner.on(",").join(errorBackendIdsForTablet));
+ + "while error backends {} error
replica info {}",
+ transactionState.getTransactionId(),
tablet.getId(), successReplicaNum,
+ quorumReplicaNum,
Joiner.on(",").join(errorBackendIdsForTablet),
+ errorBackendIdsForTablet);
throw new
TabletQuorumFailedException(transactionState.getTransactionId(), tablet.getId(),
successReplicaNum, quorumReplicaNum,
errorBackendIdsForTablet);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]