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

   ### What problem does this PR solve?
   
   Problem Summary:
   
   Two pieces of dead weight in the connect layer, found while reading the 
Arrow Flight SQL and MySQL
   paths side by side. No behavior change.
   
   **1. `ConnectType` was declared twice.** Once in `ConnectContext` and once 
in `ConnectProcessor`, so
   a processor's `connectType` and its session's `connectType` were unrelated 
types that only happened
   to carry the same two constants — nothing stopped them from disagreeing, and 
neither could be passed
   where the other was expected. Keep the `ConnectContext` one, which is the 
session's own property,
   and let the processors import it. Every subclass (including the four 
test-only ones) was resolving
   the enum through inheritance, so they now import it explicitly.
   
   **2. `FrontendServiceImpl.createForwardProcessor()` dispatched on an outcome 
that cannot happen.** It
   branched on the connect type of the forwarded context, but the context comes 
from
   `createForwardContext()` one line above, which builds it with `new 
ConnectContext(null, true,
   sessionId)` — and that constructor always sets `ConnectType.MYSQL`. So the 
Arrow Flight branch and
   the `unknown ConnectType` throw were unreachable: the master replays a 
forwarded statement over a
   `ProxyMysqlChannel` no matter which protocol the client speaks on the origin 
FE. The MySQL processor
   is now constructed directly at the one call site, with a comment recording 
why that is the only
   possibility.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test
       - [x] Previous test can cover this change.
   
     Ran the FE unit tests covering both paths: 
`ConnectProcessorDelegatedCredentialTest`,
     `ConnectProcessorRetryTest`, `AuditLogWorkloadGroupTest`, 
`ConnectContextTest`,
     `ConnectAttributesForwardTest`, `ForceForwardAllQueriesTest`, 
`FrontendServiceImplTest`,
     `DorisFlightSqlProducerTest`, `EncryptSQLTest` — 86 tests, 0 failures, 0 
errors.
   
   - Behavior changed:
       - [x] No.
   
   - Does this need documentation?
       - [x] No.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01CCAMVmoWN2MGVVsSRDCf2p
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to