DaisyModi opened a new pull request, #4199:
URL: https://github.com/apache/gobblin/pull/4199

   ## Summary
   - `JdbcWriterInitializer` previously verified staging-table droppability by 
creating a table, dropping it, and recreating it as a probe, inside a 
10-attempt loop. On an account with CREATE but not DROP, each attempt created a 
`stage_<nanoTime>` table it couldn't drop — leaving up to 10 orphaned staging 
tables per run.
   - Replace the probe with an up-front check: new 
`JdbcWriterCommands.hasDropPrivilege(database)` (default `true`; MySQL 
overrides via `SHOW GRANTS FOR CURRENT_USER()`, failing open on 
error/inconclusive parse). If DROP is positively absent, fail fast before 
creating anything.
   - Keep create-failure retries, but clean up per attempt: on a create 
failure, best-effort drop that attempt's table before retrying, so a transient 
failure never leaves an orphan behind.
   - Scope: fixes the missing-DROP-privilege path. Orphans from runs killed 
mid-write (timeout/SIGKILL) bypass cleanup and need a separate out-of-band 
sweep.
   
   ## Testing Done
   - [x] `MySqlWriterCommandsTest` covers the SHOW GRANTS parse (ALL 
PRIVILEGES, `db`.* / `*.*`, no-DROP, USAGE, different-db, DROP-in-table-name, 
null).
   - [x] `JdbcWriterInitializerTest`: no-DROP account fails fast and creates 
nothing; create-once happy path; retry-then-succeed drops the failed attempt's 
table (no orphan).
   - [ ] Not run locally (Gradle/JDK toolchain in my environment); relying on 
CI. The grant-string parse is heuristic and does not cover DROP granted via 
inactive roles — hence fail-open.
   
   Draft pending CI verification and a real GOBBLIN issue id.


-- 
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]

Reply via email to