Skip to content

Backport: support boolean loose-range for Pipe sources - #19480

Merged
Caideyipi merged 2 commits into
apache:dev/1.3from
Caideyipi:codex/cp-19464-dev13
Dec 4, 2026
Merged

Caideyipi merged 2 commits into
apache:dev/1.3from
Caideyipi:codex/cp-19464-dev13

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Cherry-pick of #19464 for the dev/1.3 branch.

Adds boolean loose-range handling for subscription topics and Pipe historical/realtime sources. A true value maps to all loose ranges, while stage-specific settings retain precedence over the global setting.

Validation: targeted Spotless and Maven tests passed for TopicConfigTest and IoTDBDataRegionSourceTest.

EXTRACTOR_HISTORY_LOOSE_RANGE_DEFAULT_VALUE)
.trim();
if (EXTRACTOR_HISTORY_LOOSE_RANGE_ALL_VALUE.equalsIgnoreCase(extractorHistoryLooseRangeValue)) {
if (EXTRACTOR_HISTORY_LOOSE_RANGE_ALL_VALUE.equalsIgnoreCase(extractorHistoryLooseRangeValue)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/historical/PipeHistoricalDataRegionTsFileSource.java:188 — loose-range=false is rejected as an invalid option instead of disabling loose range

Boolean.parseBoolean only adds the true path: false falls into the else branch, where the token stays in sloppyOptionSet and throws PipeParameterNotValidException ("Parameters in set [false] are not allowed in 'history.loose-range'"). Hence 'source.loose-range'='false' and topic loose-range=false fail pipe creation while true is accepted. Same defect at PipeRealtimeDataRegionSource.java:181.

Fix: Handle the boolean explicitly before tokenizing: "true"/"all" -> all, "false" -> no loose range (empty), otherwise parse the comma-separated time/path option list; add a false test case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this. Fixed in d31f345: both historical and realtime parsing now treat false as disabling loose range instead of tokenizing it. Added regression coverage for Pipe and Topic inputs. Verification: TopicConfigTest and IoTDBDataRegionSourceTest passed (6 tests executed; 1 existing test skipped).

@Caideyipi

Copy link
Copy Markdown
Collaborator Author

Re-review round summary (reviewed PR head c94d745f88d6744791ccf6e7298cf3a05f97bc62): The historical and realtime parsers treated false as an option-list token and rejected Pipe/topic creation. Fixed both parsers to disable loose range explicitly and added regression coverage for Pipe and Topic inputs. Verification: Spotless passed; mvn clean test -pl iotdb-client/subscription,iotdb-core/datanode -am -Dtest=TopicConfigTest,IoTDBDataRegionSourceTest -Dsurefire.failIfNoSpecifiedTests=false passed (6 tests executed, 0 failures/errors, 1 skipped). Final local SHA and confirmed PR head: d31f345709459abdb0c395fbe5af9487db1c3645. The CP PR remains open and non-draft; a fresh independent review remains pending.

@Caideyipi
Caideyipi merged commit b68ef8f into apache:dev/1.3 Dec 4, 2026
16 checks passed
@Caideyipi
Caideyipi deleted the codex/cp-19464-dev13 branch December 4, 2026 09:20
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.

2 participants