[fix](regression) Add regression for group commit executed on observe… (#26692)

This commit is contained in:
meiyi
2023-11-10 18:53:45 +08:00
committed by GitHub
parent 70fdd1f1af
commit ca47d75e83
2 changed files with 57 additions and 1 deletions

View File

@ -1813,6 +1813,7 @@ public class StmtExecutor {
TransactionStatus txnStatus = TransactionStatus.ABORTED;
String errMsg = "";
TableType tblType = insertStmt.getTargetTable().getType();
boolean isGroupCommit = false;
if (context.isTxnModel()) {
if (insertStmt.getQueryStmt() instanceof SelectStmt) {
if (((SelectStmt) insertStmt.getQueryStmt()).getTableRefs().size() > 0) {
@ -1824,6 +1825,7 @@ public class StmtExecutor {
label = context.getTxnEntry().getLabel();
txnId = context.getTxnEntry().getTxnConf().getTxnId();
} else if (insertStmt instanceof NativeInsertStmt && ((NativeInsertStmt) insertStmt).isGroupCommit()) {
isGroupCommit = true;
NativeInsertStmt nativeInsertStmt = (NativeInsertStmt) insertStmt;
int maxRetry = 3;
for (int i = 0; i < maxRetry; i++) {
@ -2013,6 +2015,9 @@ public class StmtExecutor {
if (!Strings.isNullOrEmpty(errMsg)) {
sb.append(", 'err':'").append(errMsg).append("'");
}
if (isGroupCommit) {
sb.append(", 'query_id':'").append(DebugUtil.printId(context.queryId)).append("'");
}
sb.append("}");
context.getState().setOk(loadedRows, filteredRows, sb.toString());