Repository navigation
Conversation
|
Initial CP self-review summary for candidate
|
|
Follow-up for the current head
|
|
major CREATE PIPE with variants like Fix: Normalize extractorAttributes with PipePluginAgent.normalizeSourceParameters before checkAndEnrichSourceAuthentication/checkPipePluginExistence, or make their key lookups trim- and case-insensitive. |
|
minor applyNowFunctionToExtractorAttributes runs before normalization and reads only exact keys, so CREATE PIPE with Fix: Apply the now substitution after attribute normalization, or resolve start/end-time keys with the same trim/case-insensitive lookup used by normalization. |
|
Follow-up to review comments #7335373236 and #7335373522. Reviewed head:
|
|
Fixed in |
|
Fixed in |
|
Comment-handling follow-up for reviewed head
|
| if (entry.getKey() != null | ||
| && pluginNameKey.equalsIgnoreCase(entry.getKey().trim()) | ||
| && entry.getValue() != null) { | ||
| return entry.getValue(); |
There was a problem hiding this comment.
minor iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/plugin/PipePluginAgent.java:317 — Blank plugin-name value silently disables normalization for the plugin's other attributes
getPluginName only skips null values, so a whitespace-only plugin value such as 'CONNECTOR'=' ' is returned as the plugin name; isBuiltinPlugin then returns false and normalizePluginParameters takes the custom-plugin branch, leaving every other attribute with its padded/mixed-case key and skipping duplicate-key rejection. PipeSinkConstant.getConnectorOrSinkNameWithDefault ignores blank values and falls back to iotdb-thrift-connector, so the pipe runs with the default built-in connector while ' Connector.Node-URLs ' / ' CONNECTOR.USER ' are never applied.
Fix: Ignore blank values in getPluginName (skip entries whose value trim() is empty) so such pipes resolve through the defaultPluginName path computed by normalizeSinkParameters and get normalized as the built-in plugin they actually run as.
There was a problem hiding this comment.
Fixed in 922999a0b4574243a8bd6b4b8036504390857c78. getPluginName now skips whitespace-only plugin-name values so blank connector names fall through to the default built-in connector, allowing padded keys such as Connector.Node-URLs to be normalized. Added testNormalizeSinkParametersWithBlankConnectorName.
|
Comment-handling update for reviewed head
|
| private final PipeProcessorConstructor pipeProcessorConstructor; | ||
| private final PipeSinkConstructor pipeSinkConstructor; | ||
|
|
||
| private static final Set<String> PARAMETER_VALUE_PRESERVATION_KEYS = |
There was a problem hiding this comment.
major iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/plugin/PipePluginAgent.java:63 — Value case-folding lowercases 'Z' in start-time/end-time, breaking pipe creation
Built-in values absent from PARAMETER_VALUE_PRESERVATION_KEYS are folded to trim+lowercase, but start-time/end-time (incl. history.*) are missing, so 'source.start-time'='2024-01-01T00:00:00Z' is stored and validated as '2024-01-01t00:00:00z'. DateTimeUtils.convertDatetimeStrToLong only recognizes uppercase 'Z', so it appends a zone offset and then fails to parse; PipeHistoricalDataRegionTsFileSource/PipeRealtimeDataRegionSource.validate throw PipeParameterNotValidException and CREATE/ALTER PIPE fails.
Fix: Add start-time, end-time, history.start-time, history.end-time (and processor sliding.boundary-time) to PARAMETER_VALUE_PRESERVATION_KEYS, or skip value case-folding for timestamp-valued attributes.
There was a problem hiding this comment.
Fixed in 27fe3f2c0fe7ca1418477856b956daa3bd1e73c8. The normalization allowlist now preserves values for start-time, end-time, history.start-time, history.end-time, and sliding.boundary-time, so ISO-8601 timestamps retain uppercase T and Z. Added regression coverage for these source and processor parameters. PipePluginAgentNormalizationTest passes (5 tests).
|
Comment-handling round for reviewed head
|
| public SettableFuture<ConfigTaskResult> createPipe( | ||
| final CreatePipeStatement createPipeStatement) { | ||
| if (!PipeDataNodeAgent.isPipeDataInsertionEnabled(createPipeStatement.getSourceAttributes())) { | ||
| final PipeParameters sourcePipeParameters = |
There was a problem hiding this comment.
minor iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java:1849 — Duplicate-key PipeException escapes as INTERNAL_SERVER_ERROR instead of PIPE_ERROR
createPipe (1849) and alterPipe (2074) call the new strict PipePluginAgent.normalizeSourceParameters* outside any try/catch, while every other failure in these methods is converted to IoTDBException(..., TSStatusCode.PIPE_ERROR). CREATE/ALTER PIPE with trim/case variants of one built-in key (e.g. 'source.path' and ' SOURCE.PATH ') now throws a raw PipeException there; ConfigExecution.fail() maps non-IoTDBException to INTERNAL_SERVER_ERROR, so the duplicate-key rejection is reported with a 500 code instead of the pipe error code.
Fix: Move the normalize calls into the existing validation try blocks (or catch PipeException around them) and use future.setException(new IoTDBException(msg, TSStatusCode.PIPE_ERROR.getStatusCode())), as done for validate/validateSink failures.
There was a problem hiding this comment.
Fixed in 1c66671b6b21d66fe27dc8199f59ca01e6db8a3d. CREATE PIPE now maps duplicate-key normalization failures to PIPE_ERROR; ALTER PIPE performs normalization inside its existing validation handler, which maps the same failure to PIPE_ERROR. Added a CREATE regression test asserting the returned error code; the ALTER path was verified against the existing validation flow.
|
Follow-up to the source-authentication finding: the current head normalizes source attributes before plugin checks and authentication, so trimmed, case-insensitive username/password aliases reach the validation and hashing path. No additional change was needed for this finding. |
|
Follow-up to the |
|
Review round update for PR #19476 (CP targeting
|
Summary
Backports the Topic and Pipe attribute-normalization behavior from #19418 that applies to the 1.3 branch. Built-in Topic property keys are canonicalized case-insensitively and their values are trimmed, while extension attributes remain unchanged. Built-in Pipe plugin names and parameter keys are normalized; eligible values are normalized without changing path, credential, identifier, and other case-sensitive values. Custom-plugin attributes remain untouched.
Normalization is applied during Topic creation and metadata recovery, and throughout Pipe validation, metadata recovery, and task initialization. Partial
ALTER PIPEupdates retain unspecified attributes;REPLACE ALLcontinues to use only the replacement attributes.This backport omits master-only double-living Pipe logic and table-model Topic behavior, which have no applicable counterpart in
dev/1.3.Examples
{" PATH ": " Root.SG.** ", " Extension.Option ": " Mixed Value "}. Stored attributes:{"path": "Root.SG.**", " Extension.Option ": " Mixed Value "}.{" SOURCE ": " IOTDB-EXTRACTOR ", " Source.Path ": " Root.SG.** ", " Source.Mode ": " QUERY "}. Normalized attributes includesource=iotdb-extractor,source.path= Root.SG.**, andsource.mode=query; the path value retains its case and surrounding spaces.Source
Backport of #19418, commits
9503c1d35a74b73f1453fbfec45b6fa8d4189e6b,a5551d07bd10d7b13f01f3480e1261b3a1dd23ff, and8d42f1ccb4d31d25c09973e0209c4d216c120fa1.Validation
mvn test-compile -DskipTestspassed.mvn test-compile -P with-zh-locale -DskipTestspassed.git diff --checkpassed.