Repository navigation
Conversation
|
CI follow-up for
|
|
CI repair summary
|
|
CI follow-up for reviewed commit
|
|
CI follow-up: At the failing PR head This update adds an admin short-circuit in Verification: Commit |
| TREE_STATEMENT_TO_PLAN_VISITOR.process(remainBatches.next(), null), false); | ||
| } | ||
|
|
||
| @Override |
There was a problem hiding this comment.
major iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/schemaregion/IoTDBSchemaRegionSource.java:216 — getNextEventInCurrentSnapshot calls remainBatches.next() without hasNext check
When the snapshot generator is exhausted and remainBatches was already created and fully drained by previous hasNextEventInCurrentSnapshot()/getNextEventInCurrentSnapshot() calls, the final remainBatches.next() throws NoSuchElementException. hasNextEventInCurrentSnapshot() only rebuilds remainBatches when it is null, so after the last batch is consumed the next call to getNextEventInCurrentSnapshot() (e.g. from supply() when hasNextSnapshotPlan() returned true earlier in the
…[truncated]
Fix: Guard with remainBatches.hasNext() and return/throw a controlled PipeException, or reset remainBatches to null after it is exhausted so it is rebuilt from batchVisitor.getRemainBatches().
There was a problem hiding this comment.
No code change. IoTDBSchemaRegionSource.supply() is synchronized and calls hasNextSnapshotPlan() immediately before getNextEventInCurrentSnapshot(). When the generator is exhausted, that check materializes remainBatches and returns false if it is drained, so the getter is not called with an empty iterator. While the generator still has input, the batch visitor either emits a statement or accumulates data for its remaining batch.
| }, | ||
| "PipeProcessorSubtask::executeOnce", | ||
| executionGuard); | ||
| tsFileEvent.close(); |
There was a problem hiding this comment.
major iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/subtask/processor/PipeProcessorSubtask.java:202 — tsFileEvent.close() runs even when consumption yielded, discarding parser state
consumeTabletInsertionEventsWithRetry rethrows PipeProcessorSubtaskYieldException/PipeRuntimeOutOfMemoryCriticalException to signal that the event must be retried later, and its javadoc/implementation explicitly retains the iterator and pending tablet for that retry. Here tsFileEvent.close() is called unconditionally after the call, so on a yield the parser state, pending tablet and isTsFileParsingCompleted are reset; the retried event re-parses the whole TsFile from scratch (and `mark
…[truncated]
Fix: Only call tsFileEvent.close() and markHistoricalTsFileSplit when consumption completed normally; let the yield/OOM exceptions propagate without closing the event.
There was a problem hiding this comment.
No code change. consumeTabletInsertionEventsWithRetry rethrows PipeProcessorSubtaskYieldException and PipeRuntimeOutOfMemoryCriticalException on retryable paths. Those exceptions exit the call before the following close() and markHistoricalTsFileSplit() statements execute, leaving parser state intact for retry.
|
Review-comment follow-up for reviewed head
|
| @@ -504,14 +512,42 @@ private TPipeTransferResp checkPipeTransferAuthenticated(final PipeRequestType r | |||
| } | |||
|
|
|||
| final IClientSession clientSession = SESSION_MANAGER.getCurrSession(); | |||
There was a problem hiding this comment.
critical iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java:514 — Pipe transfers from IoTDB sinks are rejected: sink connections never open a session
checkPipeTransferAuthenticated now returns NOT_LOGIN whenever SESSION_MANAGER.getCurrSession() is null or not logged in. IoTDBSyncClientManager.sendHandshakeReq only sends HANDSHAKE_DATANODE_V2 (username/password) and never calls openSession, so on every sink connection the session stays unauthenticated and all TRANSFER_* requests (tablet, tsfile, schema plan, compressed, slice) fail with NOT_LOGIN, breaking all DataNode-to-DataNode pipe replication.
Fix: Accept the pipe-handshake credential path without requiring a logged-in session: when hasPipeHandshakeCredential is true and username/userEntity are set, return null before the session check (keep the mismatch check only when a session is logged in).
There was a problem hiding this comment.
Thanks for pointing this out. Fixed in 4ed168887d45041f9aa8f05ae2306e7026ba0c38: authenticated V2 Pipe handshake credentials now permit transfers without openSession, while a logged-in session is still checked and must match the handshake identity. Slice state is also cleared when authentication changes between session-backed and handshake-only requests. IoTDBDataNodeReceiverTest passes locally (19/19); CI for this head is pending.
|
Review follow-up for
|
| if (username == null) { | ||
| return emptyTree; | ||
| } | ||
| final org.apache.iotdb.confignode.rpc.thrift.TAuthizedPatternTreeResp response = |
There was a problem hiding this comment.
major iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/PipeConfigTreePrivilegeParseVisitor.java:372 — trimPatternTree throws on partially authorized delete plans even with skipIfNoPrivileges
In trimPatternTree the condition !skipIfNoPrivileges && !originalTree.equals(intersectedTree) is inverted relative to every other check in this visitor (getAllIntersectedPatterns, getDeniedIndexes, noPrivilege). With the default skipIfNoPrivileges=true, a PipeDeleteTimeSeriesPlan/PipeDeleteLogicalViewPlan that is only partially covered by the source user's READ_SCHEMA tree throws a PipeException instead of being trimmed, aborting the pipe task on a common path.
Fix: Change the condition to !skipIfNoPrivileges && !originalTree.equals(intersectedTree) -> throw only when skipIfNoPrivileges is false, i.e. use if (!skipIfNoPrivileges && !originalTree.equals(intersectedTree)).
There was a problem hiding this comment.
No code change is needed. At the current PR head, trimPatternTree already checks !skipIfNoPrivileges && !originalTree.equals(intersectedTree), so a partially covered tree is intersected when skipIfNoPrivileges is true and rejected only when it is false. The condition shown in the comment matches the intended guard. Please let me know if you were referring to a different revision.
| String userName = attributes.get(ActiveLoadPathHelper.USER_KEY); | ||
| if (userName == null || userName.isEmpty()) { | ||
| if (sessionUsername == null || sessionUsername.isEmpty()) { | ||
| throw new IOException("The authenticated user for active LOAD could not be resolved."); |
There was a problem hiding this comment.
minor iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java:124 — Active LOAD now fails when no session is bound instead of defaulting to the admin user
appendCurrentUserIfAbsent previously fell back to AuthorityChecker.SUPER_USER when no current session existed; it now throws IOException ("The authenticated user for active LOAD could not be resolved.") and loadTsFileAsyncToActiveDir swallows it into a false return. Any programmatic/plugin caller of loadTsFileAsyncToActiveDir without a bound session (e.g. non-pipe async LOAD from a background thread) silently stops loading files.
Fix: Keep the previous SUPER_USER fallback when no session is bound and no user attribute is supplied, and only enforce the identity match when a session is present.
There was a problem hiding this comment.
I am keeping this fail-closed. Without a logged-in session or an explicitly supplied authenticated identity, the loader cannot safely attribute the file. Falling back to SUPER_USER would let a sessionless caller persist work that is later executed with administrator privileges, bypassing the identity checks added here. The SQL async path supplies the request user and authenticated marker in LoadTsFileAnalyzer#doAsyncLoad; background callers need to provide an authenticated identity instead of inheriting the administrator account. No code change was made.
|
Review-comment handling summary
|
Summary
Example
A DataNode sink authenticates with a V2 Pipe handshake as
aliceand sends a tablet transfer without opening a client session. Before this change, the transfer is rejected withNOT_LOGIN; after it, the receiver checks the authenticated identity for the required privilege, allowing authorized transfers and returningNO_PERMISSIONwhen that privilege is missing.Validation
IoTDBDataNodeReceiverTestpassed locally (19 tests, 0 failures).4ed168887d45041f9aa8f05ae2306e7026ba0c38is pending.