Skip to content

Conversation

discord9
Copy link
Contributor

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

add a sequence range to scan request for scanning memtable within given sequence range, useful for seq read for append only table's partial update query

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

@github-actions github-actions bot added size/S docs-not-required This change does not impact docs. labels Sep 10, 2025
Signed-off-by: discord9 <[email protected]>
@github-actions github-actions bot added size/M and removed size/S labels Sep 12, 2025
@discord9 discord9 marked this pull request as ready for review September 12, 2025 09:37
Signed-off-by: discord9 <[email protected]>
Comment on lines +26 to +39
From {
/// Exclusive lower bound
min: SequenceNumber,
},
To {
/// Inclusive upper bound
max: SequenceNumber,
},
Range {
/// Exclusive lower bound
min: SequenceNumber,
/// Inclusive upper bound
max: SequenceNumber,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: Maybe we can use Gt/LtEq? WDYT

Suggested change
From {
/// Exclusive lower bound
min: SequenceNumber,
},
To {
/// Inclusive upper bound
max: SequenceNumber,
},
Range {
/// Exclusive lower bound
min: SequenceNumber,
/// Inclusive upper bound
max: SequenceNumber,
},
Gt {
/// Exclusive lower bound
min: SequenceNumber,
},
LtEq {
/// Inclusive upper bound
max: SequenceNumber,
},
GtLtEq {
/// Exclusive lower bound
min: SequenceNumber,
/// Inclusive upper bound
max: SequenceNumber,
},

Comment on lines +62 to +63
/// If set, only the memtables that contain sequences greater than this value will be scanned
pub memtable_min_sequence: Option<SequenceNumber>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it exclusive?

/// Optional constraint on the sequence number of the rows to read.
/// If set, only rows with a sequence number lesser or equal to this value
/// will be returned.
pub sequence: Option<SequenceNumber>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to rename this to max_sequence?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need to rename this to max_sequence?

still useful for refilling which might still need to limit the sequence range and such

Copy link
Contributor

Choose a reason for hiding this comment

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

Will renaming this field break this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants