CritasWang commented on PR #114:
URL: https://github.com/apache/iotdb-extras/pull/114#issuecomment-5041691147

   Thanks for the quick turnaround on the native-client switch — the new 
backend reads well, and deferring the toolchain migration (plus the remaining 
frontend bot notes) to the follow-up PR is exactly what we agreed. Two things 
before this can be merged:
   
   **1. `USE` state leaks across pooled sessions**
   
   `queryTableModel` executes `USE <database>` on a pooled session and then 
returns it to the pool. In iotdb-client-go v2.0.8, `PooledTableSession.Close()` 
only restores the database when the pool itself has one configured 
([tablesessionpool.go](https://github.com/apache/iotdb-client-go/blob/v2.0.8/client/tablesessionpool.go)):
   
   ```go
   if s.session.config.Database != s.sessionPool.config.Database && 
s.sessionPool.config.Database != "" {
        err := s.session.ExecuteNonQueryStatement("use " + 
s.sessionPool.config.Database)
   ```
   
   The pool created in `getTablePool` sets only Host/Port/UserName/Password, so 
`config.Database` is empty and this reset branch never runs. Consequence: query 
A runs `USE db1` and returns the session; query B with an empty database field 
may then pick up that "dirty" session and silently query `db1` — 
nondeterministically, depending on pool scheduling. Any dashboard mixing panels 
with different (or empty) database values on the same datasource will hit this.
   
   Either fix works for me:
   - make the database field required for the table-model mode (frontend 
validation + reject empty in `verifyQuery`) — simplest and most predictable; or
   - reset the session's database state on every checkout before running the 
query.
   
   **2. Please smoke-test against a live server before merge**
   
   The PR description notes the new path "has not yet been smoke-tested against 
a live server", and the 13 unit tests all sit behind the mocked result-set 
interface — the actual RPC path (connect, auth, `USE`, timeouts, timestamp 
precision) hasn't been exercised end-to-end. Please run the new mode against a 
real IoTDB 2.x instance with a Grafana panel and post the result here (a 
screenshot or a short list of the queries you ran is fine). A multi-panel / 
multi-database scenario would also directly verify the fix for point 1.


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