Quanlong Huang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/14319 )

Change subject: IMPALA-8984: Submit several same kudu table created query 
concurrently may result in table deleted in Kudu storage

Patch Set 3:


Nice find! I can understand the bug, but have some questions for the patch.

Commit Message:

PS3, Line 7: Submit several same kudu table created query
           : concurrently may result in table deleted in Kudu storage
Could you sumarize the title to explain what this patch does? e.g. "Fix race 
condition in creating Kudu table".
The title of the commit message should not be the JIRA title while just 
explains the problem.

PS3, Line 10: If several users submitted a same kudu table created query
            : concurrently, the result could be: All these queries
            : finished, and table created in HMS, but not exists
            : in kudu storage.
Could you add the explanation for how this patch fixs the problem? Though it's 
simple but it's not good to just copy the JIRA description here...

BTW, could you specify which kind of tables are created? e.g. managed table, 
external table? with or without Kudu HMS integration? I guess the queries 
should also contains the IF NOT EXISTS clause.

PS3, Line 15: Tests
Is it possible to add a test to reproduce the problem?

File fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java:

PS3, Line 2170:       KuduCatalogOpExecutor.createManagedTable(newTable, 
I think we have race here too. If two different users sending the same CREATE 
TABLE IF NOT EXISTS statement to create a managed kudu table, it's possible 
that userA creates it in Kudu and userB creates it in HMS. So the ownership is 

PS3, Line 2182:
nit: too more spaces

PS3, Line 2185:
nit: don't need space here

PS3, Line 2187:             }
If the table has been created by other concurrent request, we should not return 
true. Otherwise, users will consider their statements succeed and they should 
be the owner (and have owner privileges). But actually only the first user is 
the owner.

PS3, Line 2191:         Table newTbl = catalog_.addTable(newTable.getDbName(), 
Same as above, if the table has been created by other concurrent request, don't 
need to create a new catalog object here.

To view, visit http://gerrit.cloudera.org:8080/14319
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1a4047bcdaa6b346765b96e8c36bb747a2b0091d
Gerrit-Change-Number: 14319
Gerrit-PatchSet: 3
Gerrit-Owner: wangsheng <sky...@163.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Comment-Date: Fri, 11 Oct 2019 07:38:19 +0000
Gerrit-HasComments: Yes

Reply via email to