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 901c863623e [Fix](schema change) fix tablet meta write race (#30081)
901c863623e is described below
commit 901c863623ed995ac277df90d20f8483c0a2165f
Author: Luwei <[email protected]>
AuthorDate: Thu Jan 18 10:04:55 2024 +0800
[Fix](schema change) fix tablet meta write race (#30081)
---
.../apache/doris/service/FrontendServiceImpl.java | 24 +++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
index 280cf5ebf77..a9ae485d8f9 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
@@ -2002,14 +2002,24 @@ public class FrontendServiceImpl implements
FrontendService.Iface {
}
long timeoutMs = request.isSetThriftRpcTimeoutMs() ?
request.getThriftRpcTimeoutMs() : 5000;
Table table = db.getTableOrMetaException(request.getTbl(),
TableType.OLAP);
- if (!((OlapTable) table).getTableProperty().getUseSchemaLightChange()
&& (request.getGroupCommitMode() != null
- && !request.getGroupCommitMode().equals("off_mode"))) {
- throw new UserException("table light_schema_change is false, can't
do stream load with group commit mode");
+ if (!table.tryReadLock(timeoutMs, TimeUnit.MILLISECONDS)) {
+ throw new UserException(
+ "get table read lock timeout, database=" + fullDbName +
",table=" + table.getName());
+ }
+ try {
+ if (!((OlapTable)
table).getTableProperty().getUseSchemaLightChange()
+ && (request.getGroupCommitMode() != null
+ && !request.getGroupCommitMode().equals("off_mode"))) {
+ throw new UserException(
+ "table light_schema_change is false, can't do stream
load with group commit mode");
+ }
+ result.setDbId(db.getId());
+ result.setTableId(table.getId());
+ result.setBaseSchemaVersion(((OlapTable)
table).getBaseSchemaVersion());
+ return generatePlanFragmentParams(request, db, fullDbName,
(OlapTable) table, timeoutMs);
+ } finally {
+ table.readUnlock();
}
- result.setDbId(db.getId());
- result.setTableId(table.getId());
- result.setBaseSchemaVersion(((OlapTable)
table).getBaseSchemaVersion());
- return generatePlanFragmentParams(request, db, fullDbName, (OlapTable)
table, timeoutMs);
}
private TExecPlanFragmentParams
generatePlanFragmentParams(TStreamLoadPutRequest request, Database db,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]