You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2024/01/18 02:05:39 UTC
(doris) branch branch-2.1 updated: [Fix](schema change) fix tablet meta write race (#30081)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 855fc3d735b [Fix](schema change) fix tablet meta write race (#30081)
855fc3d735b is described below
commit 855fc3d735b7a0fa318c5e6460bbf9817b9256cc
Author: Luwei <81...@qq.com>
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 c02bce86b89..9a98576b110 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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org