You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "caiconghui (via GitHub)" <gi...@apache.org> on 2023/06/06 02:56:28 UTC

[GitHub] [doris] caiconghui opened a new pull request, #20480: [fix](alter) fix pontential concurrent issue for alter when check olap table state normal outside write lock scope is not automic

caiconghui opened a new pull request, #20480:
URL: https://github.com/apache/doris/pull/20480

   ## Proposed changes
   
   Issue Number: close #xxx
   
   now, we check some olap table state normal outside write lock scope, the table state may be changed to unnormal when we do alter operation
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] caiconghui commented on a diff in pull request #20480: [fix](alter) fix potential concurrent issue for alter when check olap table state normal outside write lock scope is not atomic

Posted by "caiconghui (via GitHub)" <gi...@apache.org>.
caiconghui commented on code in PR #20480:
URL: https://github.com/apache/doris/pull/20480#discussion_r1224359378


##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -2471,13 +2466,6 @@ public void modifyTableLightSchemaChange(Database db, OlapTable olapTable,
             throws DdlException {
 
         LOG.debug("indexSchemaMap:{}, indexes:{}", indexSchemaMap, indexes);
-        if (olapTable.getState() == OlapTableState.ROLLUP) {
-            throw new DdlException("Table[" + olapTable.getName() + "]'s is doing ROLLUP job");
-        }
-
-        // for now table's state can only be NORMAL
-        Preconditions.checkState(olapTable.getState() == OlapTableState.NORMAL, olapTable.getState().name());
-

Review Comment:
   we already check table state inside the table write lock no need double check here



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] caiconghui commented on pull request #20480: [fix](alter) fix pontential concurrent issue for alter when check olap table state normal outside write lock scope is not atomic

Posted by "caiconghui (via GitHub)" <gi...@apache.org>.
caiconghui commented on PR #20480:
URL: https://github.com/apache/doris/pull/20480#issuecomment-1578118891

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] caiconghui commented on pull request #20480: [fix](alter) fix pontential concurrent issue for alter when check olap table state normal outside write lock scope is not atomic

Posted by "caiconghui (via GitHub)" <gi...@apache.org>.
caiconghui commented on PR #20480:
URL: https://github.com/apache/doris/pull/20480#issuecomment-1578064867

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] Tanya-W commented on a diff in pull request #20480: [fix](alter) fix potential concurrent issue for alter when check olap table state normal outside write lock scope is not atomic

Posted by "Tanya-W (via GitHub)" <gi...@apache.org>.
Tanya-W commented on code in PR #20480:
URL: https://github.com/apache/doris/pull/20480#discussion_r1224337777


##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -2471,13 +2466,6 @@ public void modifyTableLightSchemaChange(Database db, OlapTable olapTable,
             throws DdlException {
 
         LOG.debug("indexSchemaMap:{}, indexes:{}", indexSchemaMap, indexes);
-        if (olapTable.getState() == OlapTableState.ROLLUP) {
-            throw new DdlException("Table[" + olapTable.getName() + "]'s is doing ROLLUP job");
-        }
-
-        // for now table's state can only be NORMAL
-        Preconditions.checkState(olapTable.getState() == OlapTableState.NORMAL, olapTable.getState().name());
-

Review Comment:
   Is ok removing this check here? I think here also need `olapTable.checkNormalStateForAlter();`



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java:
##########
@@ -1489,21 +1489,9 @@ public long getReplicaCount() {
         return replicaCount;
     }
 
-    public void checkStableAndNormal(String clusterName) throws DdlException {
+    public void checkNormalStateForAlter() throws DdlException {
         if (state != OlapTableState.NORMAL) {
-            throw new DdlException("Table[" + name + "]'s state is not NORMAL. "
-                    + "Do not allow doing materialized view");
-        }
-        // check if all tablets are healthy, and no tablet is in tablet scheduler
-        boolean isStable = isStable(Env.getCurrentSystemInfo(),

Review Comment:
   why remove this logic which check all tablets healthy?



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] caiconghui commented on pull request #20480: [fix](alter) fix pontential concurrent issue for alter when check olap table state normal outside write lock scope is not atomic

Posted by "caiconghui (via GitHub)" <gi...@apache.org>.
caiconghui commented on PR #20480:
URL: https://github.com/apache/doris/pull/20480#issuecomment-1578617021

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei merged pull request #20480: [fix](alter) fix potential concurrent issue for alter when check olap table state normal outside write lock scope is not atomic

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #20480:
URL: https://github.com/apache/doris/pull/20480


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] caiconghui commented on a diff in pull request #20480: [fix](alter) fix potential concurrent issue for alter when check olap table state normal outside write lock scope is not atomic

Posted by "caiconghui (via GitHub)" <gi...@apache.org>.
caiconghui commented on code in PR #20480:
URL: https://github.com/apache/doris/pull/20480#discussion_r1224362975


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java:
##########
@@ -1489,21 +1489,9 @@ public long getReplicaCount() {
         return replicaCount;
     }
 
-    public void checkStableAndNormal(String clusterName) throws DdlException {
+    public void checkNormalStateForAlter() throws DdlException {
         if (state != OlapTableState.NORMAL) {
-            throw new DdlException("Table[" + name + "]'s state is not NORMAL. "
-                    + "Do not allow doing materialized view");
-        }
-        // check if all tablets are healthy, and no tablet is in tablet scheduler
-        boolean isStable = isStable(Env.getCurrentSystemInfo(),

Review Comment:
   actually checkTableStable function will check table stable, no need to double check here



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #20480: [fix](alter) fix potential concurrent issue for alter when check olap table state normal outside write lock scope is not atomic

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20480:
URL: https://github.com/apache/doris/pull/20480#issuecomment-1584748296

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] caiconghui commented on pull request #20480: [fix](alter) fix pontential concurrent issue for alter when check olap table state normal outside write lock scope is not automic

Posted by "caiconghui (via GitHub)" <gi...@apache.org>.
caiconghui commented on PR #20480:
URL: https://github.com/apache/doris/pull/20480#issuecomment-1577820467

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org