[enhancement](publish) print detailed info for failed publish (#20309)

This commit is contained in:
Yongqiang YANG
2023-06-01 22:24:16 +08:00
committed by GitHub
parent 34c1cda14a
commit 363e78f08f

View File

@ -928,9 +928,19 @@ public class DatabaseTransactionMgr {
for (Tablet tablet : index.getTablets()) {
int healthReplicaNum = 0;
for (Replica replica : tablet.getReplicas()) {
if (!errorReplicaIds.contains(replica.getId()) && replica.getLastFailedVersion() < 0) {
if (replica.getLastFailedVersion() >= 0) {
LOG.info("publish version failed for transaction {} on tablet {},"
+ " on replica {} due to lastFailedVersion >= 0",
transactionState, tablet, replica);
continue;
}
if (!errorReplicaIds.contains(replica.getId())) {
if (replica.checkVersionCatchUp(partition.getVisibleVersion(), true)) {
++healthReplicaNum;
} else {
LOG.info("publish version failed for transaction {} on tablet {},"
+ " on replica {} due to not catchup",
transactionState, tablet, replica);
}
} else if (replica.getVersion() >= partitionCommitInfo.getVersion()) {
// the replica's version is larger than or equal to current transaction
@ -938,6 +948,9 @@ public class DatabaseTransactionMgr {
// TODO(cmy): actually I have no idea why we need this check
errorReplicaIds.remove(replica.getId());
++healthReplicaNum;
} else {
LOG.info("publish version failed for transaction {} on tablet {},"
+ " on replica {} due to version hole", transactionState, tablet, replica);
}
}