d-wang-commit opened a new pull request, #18963:
URL: https://github.com/apache/iotdb/pull/18963

   ## Description
   
   ### Keep authentication outside the failover window
   
   `IoTDBNodeStatusFailoverIT.testLiveOldLeaderPartitionAndQuorumRecovery` 
opens a new JDBC connection for each status assertion after stopping a DataNode 
and partitioning the old ConfigNode leader. A failure in `openSession` is 
consequently reported as "SHOW through the healthy DataNode cannot reach the 
elected majority", even when no SHOW statement has executed.
   
   This was reproduced in a downstream deployment where login reads 
password-history storage: stopping its only SchemaRegion replica while 
partitioning the ConfigNodes caused session creation to exceed the JDBC socket 
timeout.
   
   Establish the JDBC connection to the healthy DataNode before injecting 
failures and reuse it for the existing SHOW assertions. Preserve the 
node-status persistence, leader-transfer, and quorum-recovery assertions. Split 
the helpers so other scenarios retain their existing connection lifecycle, and 
use `SessionConfig.DEFAULT_USER` and `SessionConfig.DEFAULT_PASSWORD` for 
default credentials.
   
   ### Tests
   
   - UT: no tests added or modified; no unit tests run.
   - IT: modified the existing 
`IoTDBNodeStatusFailoverIT#testLiveOldLeaderPartitionAndQuorumRecovery`; no new 
test cases.
   - Before PR preparation/rebase, the targeted ClusterIT passed on Apache 
IoTDB (1 test, 0 failures/errors), and the downstream reproduction passed with 
the connection-reuse change (1 test, 0 failures/errors). Spotless also passed.
   - No tests or compilation are being rerun for this submission/rebase.
   
   ### Side effects and risks
   
   This changes test code only. The scenario verifies SHOW routing through an 
established session; it does not verify new-login availability during failures. 
A JDBC reconnect can still invoke authentication. Schema/Data replication 
factors and socket timeouts are unchanged.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [x] been tested in a test IoTDB cluster.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   - `IoTDBNodeStatusFailoverIT`: reuse a pre-established JDBC session in the 
live-old-leader partition and quorum-recovery scenario, and separate connection 
ownership from status assertions.
   


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