OIiveirra commented on code in PR #68726:
URL: https://github.com/apache/doris/pull/68726#discussion_r4237004260


##########
fe/fe-core/src/main/java/org/apache/doris/load/StreamLoadHandler.java:
##########
@@ -241,9 +241,17 @@ private void setDbAndTable() throws UserException, 
MetaNotFoundException {
 
         if (result != null) {
             OlapTable olapTable = tables.get(0);
-            result.setDbId(db.getId());
-            result.setTableId(olapTable.getId());
-            result.setBaseSchemaVersion(olapTable.getBaseSchemaVersion());
+            if (!olapTable.tryReadLock(timeoutMs, TimeUnit.MILLISECONDS)) {

Review Comment:
   This protects the base schema version read against concurrent schema change. 
SchemaChangeJobV2 removes the old base-index metadata before switching 
baseIndexId while holding the table write lock; an unlocked 
getBaseSchemaVersion() can dereference the removed metadata in that window. The 
Cloud CI failure was traced to this exact read, and StreamLoadHandlerTest 
reproduces the replacement window with real table locks. The timed read lock 
waits for that update and is released in finally. Commit 85e1f4f019c also 
covers the parallel load_sql HTTP result path. The three focused FE suites pass 
18 tests, including HTTP lock ownership/release coverage; Maven Checkstyle 
passes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to