Conversation
DaZuiZui
force-pushed
the
feat/cq-calendar-month-intervals
branch
from
September 4, 2026 03:21
2e70ead to
b81d179
Compare
Treat CQ EVERY/RANGE mo/y as calendar months and years instead of flattening them to 30d/365d. Reuse GROUP BY TIME calendar arithmetic, fail closed on mixed-version clusters, and keep RANGE anchored to the original boundary. Fixes apache#18428
DaZuiZui
force-pushed
the
feat/cq-calendar-month-intervals
branch
from
September 20, 2026 03:34
aeaad27 to
d4ffaf8
Compare
ReadWriteIOUtils.readInt throws a generic IOException at EOF, so CQInfo now treats a short remaining stream as a pre-extension snapshot instead of catching EOFException. Legacy CQs also reconcile durable progress after CQ_UPDATE_LAST_EXEC_TIME_ERROR so they do not stall.
Fixed EVERY + calendar RANGE CQs persist everyInterval as 0. Recovery must use calendarAware when computing retry delay so restart/leader failover does not busy-spin on failure.
Add n=0 RANGE, DISCARD skip, mixed-version ingress, and an execution IT that asserts EVERY 1mo RANGE 1mo uses the just-finished natural month.
CQInfo.processLoadSnapshot used a raw FileInputStream, whose available() does not contractually guarantee the remaining byte count, for the extension-marker presence check in deserialize(). Read the snapshot into memory via ByteArrayInputStream instead, matching the pattern already used in NodeInfo for the same kind of optional-trailing-data probe. Also remove the occurrenceIndex < 0 branch in CQScheduleTask#occurrenceAt: every call site (both constructors and persistProgress's legacy-path guard) only invokes it once occurrenceIndex is already non-negative, so the branch was unreachable.
… CQ calendar durations Issue apache#18428 only asks for calendar-aware EVERY/RANGE duration support in continuous queries. The previous commits on this branch additionally introduced a cluster-wide node capability negotiation mechanism (TNodeVersionInfo.supportedCQDurationEncodingVersions, snapshot/procedure/ plan serialization tails guarded by a magic marker, and "fail closed" gating in NodeManager/CQManager/ClusterConfigTaskExecutor that rejects calendar-duration CQs unless every node in the cluster advertises support). That mechanism addresses a mixed-version-cluster rollout concern that the issue never raised, and added a second, independent surface for bugs. This trims the branch back to what the issue actually asks for: the TCQDuration wire format, TCreateCQReq's structured duration fields, and CQManager's structural/semantic validation stay; the capability-negotiation scaffolding and its tests are removed.
…ion from CQ calendar durations" This reverts commit 857388d.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation
This change adds calendar-aware
moandydurations to Continuous QueryEVERYandRANGEclauses.(monthPart, nonMonthDuration)values instead of flattening calendar units into fixed milliseconds.GROUP BY TIME.TCreateCQReq, while retaining legacy fixed-duration fields and compatibility handling for existing requests and snapshots.Fixes #18428