rishi-rana commented on issue #35166:
URL: 
https://github.com/apache/shardingsphere/issues/35166#issuecomment-5707750763

   I'd like to work on this issue.
   
   Scope as I understand it: `ProxySQLExecutor#checkExecutePrerequisites` 
currently rejects metadata-changing DDL inside a transaction for PostgreSQL, 
because `PostgreSQLDatabaseMetaData#getTransactionOption` passes 
`isSupportMetaDataRefreshInTransaction = false`. The deferred refresh described 
here and that flag need to change together.
   
   Plan:
   
   1. Track the tables touched by metadata-changing DDL on the 
transaction-scoped context, instead of refreshing immediately in 
`StandardDatabaseProxyConnector#doExecute`.
   2. Drain that queue and run a single refresh after a successful commit in 
`ProxyBackendTransactionManager#commit` — before the connection context is 
cleared — and discard it on rollback.
   3. Set `isSupportMetaDataRefreshInTransaction` to `true` for PostgreSQL once 
1 and 2 are in place.
   
   This covers XA and BASE without additional work: 
`ProxyBackendTransactionManager#commit` is the single commit entry point for 
all three transaction types, with the local/distributed split inside it, so the 
deferral is transaction-type agnostic. PostgreSQL already declares 
`isSupportDDLInXATransaction = true`, so step 3 adds no new claim about XA 
beyond making the refresh correct.
   
   I'll cover the deferral and drain with unit tests, plus an E2E case for the 
begin/DDL/commit sequence in the report.
   


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