@@ -2443,23 +2443,33 @@ private void handleInsertStmt() throws Exception {
2443
2443
PGroupCommitInsertResponse response = groupCommitPlanner .executeGroupCommitInsert (context , rows );
2444
2444
TStatusCode code = TStatusCode .findByValue (response .getStatus ().getStatusCode ());
2445
2445
ProtocolStringList errorMsgsList = response .getStatus ().getErrorMsgsList ();
2446
- if (code == TStatusCode .DATA_QUALITY_ERROR && !errorMsgsList .isEmpty () && errorMsgsList .get (0 )
2447
- .contains ("schema version not match" )) {
2446
+ boolean schemaVersionNotMatch = code == TStatusCode .DATA_QUALITY_ERROR && !errorMsgsList .isEmpty ()
2447
+ && errorMsgsList .get (0 ).contains ("schema version not match" );
2448
+ boolean canNotGetBlockQueue = code != TStatusCode .OK && !errorMsgsList .isEmpty () && errorMsgsList .get (0 )
2449
+ .contains ("can not get a block queue" );
2450
+ if (schemaVersionNotMatch || canNotGetBlockQueue ) {
2448
2451
LOG .info ("group commit insert failed. stmt: {}, query_id: {}, db_id: {}, table_id: {}"
2449
2452
+ ", schema version: {}, backend_id: {}, status: {}, retry: {}" ,
2450
2453
insertStmt .getOrigStmt ().originStmt , DebugUtil .printId (context .queryId ()), dbId , tableId ,
2451
2454
nativeInsertStmt .getBaseSchemaVersion (), groupCommitPlanner .getBackendId (),
2452
2455
response .getStatus (), i );
2453
2456
if (i < maxRetry ) {
2454
- List <TableIf > tables = Lists .newArrayList (insertStmt .getTargetTable ());
2455
- tables .sort ((Comparator .comparing (TableIf ::getId )));
2456
- MetaLockUtils .readLockTables (tables );
2457
- try {
2458
- insertStmt .reset ();
2459
- analyzer = new Analyzer (context .getEnv (), context );
2460
- analyzeAndGenerateQueryPlan (context .getSessionVariable ().toThrift ());
2461
- } finally {
2462
- MetaLockUtils .readUnlockTables (tables );
2457
+ if (schemaVersionNotMatch ) {
2458
+ List <TableIf > tables = Lists .newArrayList (insertStmt .getTargetTable ());
2459
+ tables .sort ((Comparator .comparing (TableIf ::getId )));
2460
+ MetaLockUtils .readLockTables (tables );
2461
+ try {
2462
+ insertStmt .reset ();
2463
+ analyzer = new Analyzer (context .getEnv (), context );
2464
+ analyzeAndGenerateQueryPlan (context .getSessionVariable ().toThrift ());
2465
+ } finally {
2466
+ MetaLockUtils .readUnlockTables (tables );
2467
+ }
2468
+ }
2469
+ long debugTableId = DebugPointUtil .getDebugParamOrDefault ("GroupCommitInsert.retry" , 0 );
2470
+ if (debugTableId == tableId ) {
2471
+ // Thread.sleep(10000);
2472
+ GroupCommitPlanner .removeBeDebugPoint ();
2463
2473
}
2464
2474
continue ;
2465
2475
} else {
0 commit comments