Skip to content

Conversation

@ronaldngounou
Copy link
Member

@ronaldngounou ronaldngounou commented Oct 11, 2025

Key changes:

  1. Update Line 168 to address issue Documentation for Range should state that revision filtering does not affect returned count. #1063
`count` - the actual number of keys within the range when requested. 
Unlike Kvs, it is unaffected by limits and filters (e.g., Min/Max, Create/Modify, Revisions) 
and reflect the full count within the specified range.
  1. Improvement to the current documentation by reflecting the latest changes from uptream code base to ensure it remains consistency and similar issues are not occuring. Some information were outdated.
    Source of my changes: https://github.com/etcd-io/etcd/blob/main/api/etcdserverpb/rpc.proto

Testing

npm run check-links
npm run build
npm run serve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ronaldngounou
Once this PR has been reviewed and has the lgtm label, please assign jberkus for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ronaldngounou ronaldngounou force-pushed the issue1063-revision_filtering branch from 10a8a58 to ea616b8 Compare October 11, 2025 08:55
@ronaldngounou ronaldngounou changed the title Update API documentation: evision field doesn't affect count Update API documentation Oct 11, 2025
Copy link
Contributor

@jberkus jberkus left a comment

Choose a reason for hiding this comment

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

Overall a nice improvement to this doc, just need some follow-up cleanup. Thanks!

@ronaldngounou ronaldngounou force-pushed the issue1063-revision_filtering branch from ea616b8 to 1667b38 Compare October 19, 2025 04:55
- Revision field doesn't affect count - Solves Issue etcd-io#1063
- Update API documentation for consistency with upstream code
reference: https://github.com/etcd-io/etcd/blob/main/api/etcdserverpb/rpc.proto

Signed-off-by: Ronald Ngounou <[email protected]>
@ronaldngounou ronaldngounou force-pushed the issue1063-revision_filtering branch from 1667b38 to a7d34ed Compare October 19, 2025 05:02
@ronaldngounou ronaldngounou requested a review from jberkus October 19, 2025 05:04
@wendy-ha18
Copy link
Contributor

cc @wendy-ha18 for reviewing.

@ronaldngounou
Copy link
Member Author

Reminder on the review @wendy-ha18 @jberkus

* Max_Mod_Revision - the upper bound for key mod revisions; filters out greater mod revisions.
* Min_Create_Revision - the lower bound for key create revisions; filters out lesser create revisions.
* Max_Create_Revision - the upper bound for key create revisions; filters out greater create revisions.
* `key`, `range_end` - The key range to fetch.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `key`, `range_end` - The key range to fetch.
* `key`, `range_end` - the key range to fetch.

Copy link
Contributor

Choose a reason for hiding this comment

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

keep the format consistent.

* Type - The kind of event. A PUT type indicates new data has been stored to the key. A DELETE indicates the key was deleted.
* KV - The KeyValue associated with the event. A PUT event contains current kv pair. A PUT event with kv.Version=1 indicates the creation of a key. A DELETE event contains the deleted key with its modification revision set to the revision of deletion.
* Prev_KV - The key-value pair for the key from the revision immediately before the event. To save bandwidth, it is only filled out if the watch has explicitly enabled it.
* `type` - The kind of event. A PUT type indicates new data has been stored to the key. A DELETE indicates the key was deleted.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `type` - The kind of event. A PUT type indicates new data has been stored to the key. A DELETE indicates the key was deleted.
* `type` - the kind of event. A PUT type indicates new data has been stored to the key. A DELETE indicates the key was deleted.

* KV - The KeyValue associated with the event. A PUT event contains current kv pair. A PUT event with kv.Version=1 indicates the creation of a key. A DELETE event contains the deleted key with its modification revision set to the revision of deletion.
* Prev_KV - The key-value pair for the key from the revision immediately before the event. To save bandwidth, it is only filled out if the watch has explicitly enabled it.
* `type` - The kind of event. A PUT type indicates new data has been stored to the key. A DELETE indicates the key was deleted.
* `kv` - The KeyValue associated with the event. A PUT event contains current kv pair. A PUT event with kv.Version=1 indicates the creation of a key. A DELETE event contains the deleted key with its modification revision set to the revision of deletion.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `kv` - The KeyValue associated with the event. A PUT event contains current kv pair. A PUT event with kv.Version=1 indicates the creation of a key. A DELETE event contains the deleted key with its modification revision set to the revision of deletion.
* `kv` - the KeyValue associated with the event. A PUT event contains current kv pair. A PUT event with kv.Version=1 indicates the creation of a key. A DELETE event contains the deleted key with its modification revision set to the revision of deletion.

* Prev_KV - The key-value pair for the key from the revision immediately before the event. To save bandwidth, it is only filled out if the watch has explicitly enabled it.
* `type` - The kind of event. A PUT type indicates new data has been stored to the key. A DELETE indicates the key was deleted.
* `kv` - The KeyValue associated with the event. A PUT event contains current kv pair. A PUT event with kv.Version=1 indicates the creation of a key. A DELETE event contains the deleted key with its modification revision set to the revision of deletion.
* `prev_kv` - The key-value pair for the key from the revision immediately before the event. To save bandwidth, it is only filled out if the watch has explicitly enabled it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `prev_kv` - The key-value pair for the key from the revision immediately before the event. To save bandwidth, it is only filled out if the watch has explicitly enabled it.
* `prev_kv` - the key-value pair for the key from the revision immediately before the event. To save bandwidth, it is only filled out if the watch has explicitly enabled it.

* Progress_Notify - When set, the watch will periodically receive a WatchResponse with no events, if there are no recent events. It is useful when clients wish to recover a disconnected watcher starting from a recent known revision. The etcd server decides how often to send notifications based on current server load.
* Filters - A list of event types to filter away at server side.
* Prev_Kv - When set, the watch receives the key-value data from before the event happens. This is useful for knowing what data has been overwritten.
* `key`, `range_end` - The key range to watch.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `key`, `range_end` - The key range to watch.
* `key`, `range_end` - the key range to watch.

* Filters - A list of event types to filter away at server side.
* Prev_Kv - When set, the watch receives the key-value data from before the event happens. This is useful for knowing what data has been overwritten.
* `key`, `range_end` - The key range to watch.
* `start_revision` - An optional revision for where to inclusively begin watching. If not given, it will stream events following the revision of the watch creation response header revision. The entire available event history can be watched starting from the last compaction revision.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `start_revision` - An optional revision for where to inclusively begin watching. If not given, it will stream events following the revision of the watch creation response header revision. The entire available event history can be watched starting from the last compaction revision.
* `start_revision` - an optional revision for where to inclusively begin watching. If not given, it will stream events following the revision of the watch creation response header revision. The entire available event history can be watched starting from the last compaction revision.

* Prev_Kv - When set, the watch receives the key-value data from before the event happens. This is useful for knowing what data has been overwritten.
* `key`, `range_end` - The key range to watch.
* `start_revision` - An optional revision for where to inclusively begin watching. If not given, it will stream events following the revision of the watch creation response header revision. The entire available event history can be watched starting from the last compaction revision.
* `progress_notify` - When set, the watch will periodically receive a WatchResponse with no events, if there are no recent events. It is useful when clients wish to recover a disconnected watcher starting from a recent known revision. The etcd server decides how often to send notifications based on current server load.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `progress_notify` - When set, the watch will periodically receive a WatchResponse with no events, if there are no recent events. It is useful when clients wish to recover a disconnected watcher starting from a recent known revision. The etcd server decides how often to send notifications based on current server load.
* `progress_notify` - when set, the watch will periodically receive a WatchResponse with no events, if there are no recent events. It is useful when clients wish to recover a disconnected watcher starting from a recent known revision. The etcd server decides how often to send notifications based on current server load.

* `key`, `range_end` - The key range to watch.
* `start_revision` - An optional revision for where to inclusively begin watching. If not given, it will stream events following the revision of the watch creation response header revision. The entire available event history can be watched starting from the last compaction revision.
* `progress_notify` - When set, the watch will periodically receive a WatchResponse with no events, if there are no recent events. It is useful when clients wish to recover a disconnected watcher starting from a recent known revision. The etcd server decides how often to send notifications based on current server load.
* `filters` - A list of event types to filter away at server side.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `filters` - A list of event types to filter away at server side.
* `filters` - a list of event types to filter away at server side.

* `start_revision` - An optional revision for where to inclusively begin watching. If not given, it will stream events following the revision of the watch creation response header revision. The entire available event history can be watched starting from the last compaction revision.
* `progress_notify` - When set, the watch will periodically receive a WatchResponse with no events, if there are no recent events. It is useful when clients wish to recover a disconnected watcher starting from a recent known revision. The etcd server decides how often to send notifications based on current server load.
* `filters` - A list of event types to filter away at server side.
* `prev_kv` - When set, the watch receives the key-value data from before the event happens. This is useful for knowing what data has been overwritten.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `prev_kv` - When set, the watch receives the key-value data from before the event happens. This is useful for knowing what data has been overwritten.
* `prev_kv` - when set, the watch receives the key-value data from before the event happens. This is useful for knowing what data has been overwritten.

* `ID` - the lease that was refreshed with a new TTL.
* `TTL` - the new time-to-live, in seconds, that the lease has remaining.

[watch-api-guarantees]: ../api_guarantees/#watch-apis
Copy link
Contributor

Choose a reason for hiding this comment

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

This relative link is currently broken. Could you please help to update it as well? Thank you

Copy link
Contributor

Choose a reason for hiding this comment

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

The gRPC API listing link is also error.

[grpc-api]: ../../dev-guide/api_reference_v3/

@wendy-ha18
Copy link
Contributor

I only had a few small comments, but the overall of this PR is LGTM.
We could merge it after the format and broken links being fixed. Thank Ronal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants