yuqi1129 opened a new issue, #14792: URL: https://github.com/apache/gravitino/issues/14792
### Version main branch, commit f475443da6 (2.0.0-SNAPSHOT) ### Describe what's wrong With authorization enabled, `TableHookDispatcher.createTable` sets the owner by table name after the table is created. The name can point to a different table by then: 1. User A creates table `x`. 2. Before A's owner step runs, another request drops `x`. 3. User C creates a new table `x`. 4. A's owner step finds the new table by name and sets A as its owner. The new table then has the wrong owner. C can lose ownership, depending on which owner step runs last. Priority is low. It needs a drop and a create of the same name, by different users, inside the short gap of one create. ### Error message and/or stacktrace None. The request succeeds and the stored owner is wrong. ### How to reproduce Found by reading the code. Not reproduced. A test needs to pause A's request between the create and the owner step. ### Additional context - #14787 fixes the 404 from this race, but not the wrong owner. - A fix needs to check the table ID returned by the create, inside the owner write. A check by name, or an ID check before a separate write, is not enough. - #14557 tried this and was closed because it added too much to the core interfaces. - Other create paths in #14786 have the same pattern. -- 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]
