Skip to content

Support internal sessions through inherited client RPC services - #19125

Open
shuwenwei wants to merge 3 commits into
masterfrom
feature/internal-rpc-inherit-client-rpc
Open

shuwenwei wants to merge 3 commits into
masterfrom
feature/internal-rpc-inherit-client-rpc

Conversation

@shuwenwei

Copy link
Copy Markdown
Member

Description

Allow callers on the trusted cluster network to reuse the existing client session protocol through the DataNode internal RPC endpoint. Internal callers can run queries and writes under an existing user's identity without maintaining a separate query protocol or using an ingress account.

RPC and session lifecycle

  • Make IDataNodeRPCService extend IClientRPCService and inherit its Java implementation.
  • Register a connection-scoped session on internal connections, clean up resources on disconnect, and restore the previous session after CQ execution.
  • Rename the existing internal configuration and audit-write operations to showConfigurationInternal and insertRecordInternal, preserving their distinct behavior and updating ConfigNode callers.

Identity and clients

  • Add an overridable login hook. External sessions retain password validation and login-lock behavior. The internal implementation trusts the supplied username on the internal endpoint, resolves its actual user ID, rejects unknown users, and retains existing operation-level permission checks.
  • Share protocol validation, session initialization, and login auditing between the two login paths.
  • Add IInternalSessionBuilder<T> and buildInternal(INodeSupplier) entry points for tree sessions, table sessions, and table subscription-management sessions.
  • Let callers supply internal endpoints through the existing INodeSupplier; disable external discovery and endpoint redirection for internal sessions. Reuse existing session connections and result sets.

Compatibility and trust boundary

Username-only login is available exclusively through the trusted DataNode internal endpoint; it is not a client-facing authentication option. This change inherits the full client RPC surface and is not restricted to read-only queries. Existing CN/DN internal callers must use the renamed configuration and audit-write RPCs. Subscription Pull/Push consumers and connection pools are not adapted in this change.

Validation

  • Reviewed the source-level execution and cleanup paths and ran git diff --check.
  • No compilation, Thrift generation, formatter, unit tests, integration tests, or cluster validation was run, as requested.
Key changed/added classes

IDataNodeRPCService, DataNodeInternalRPCServiceImpl, ClientRPCServiceImpl, SessionManager, InternalServiceThriftHandler, IInternalSessionBuilder, InternalSession, and InternalSubscriptionTableSession.

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.99237% with 207 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.28%. Comparing base (65ef92f) to head (282fc56).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...n/consumer/base/AbstractSubscriptionProviders.java 0.00% 54 Missing ⚠️
...ache/iotdb/db/protocol/session/SessionManager.java 0.00% 46 Missing ⚠️
...java/org/apache/iotdb/session/InternalSession.java 0.00% 23 Missing ⚠️
...subscription/InternalSubscriptionTableSession.java 0.00% 23 Missing ⚠️
.../subscription/SubscriptionTableSessionBuilder.java 0.00% 10 Missing ⚠️
...ava/org/apache/iotdb/session/pool/SessionPool.java 82.35% 9 Missing ⚠️
...l/thrift/handler/InternalServiceThriftHandler.java 0.00% 8 Missing ⚠️
...r/table/InternalSubscriptionTablePullConsumer.java 0.00% 6 Missing ⚠️
...ol/thrift/impl/DataNodeInternalRPCServiceImpl.java 16.66% 5 Missing ⚠️
.../org/apache/iotdb/session/TableSessionBuilder.java 0.00% 4 Missing ⚠️
... and 10 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #19125      +/-   ##
============================================
- Coverage     48.29%   48.28%   -0.01%     
  Complexity      625      625              
============================================
  Files          5572     5576       +4     
  Lines        411719   411943     +224     
  Branches      54229    54271      +42     
============================================
+ Hits         198820   198924     +104     
- Misses       212899   213019     +120     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant