~bigbes/tarantool-etcd · parade

main · last commit 1 month ago · 2npkec0r

← Back to the parade

tarantool-etcd-agm Negative Watch start_revision replays entire history instead of cancelling Lined Up

status: open P1 bug etcd-changelog-sweep
bd update tarantool-etcd-agm --claim bd close tarantool-etcd-agm
Created byEugene Blikh
Ownerbigbes@gmail.com
Created2026-07-17T13:19:08Z
Updated2026-07-17T13:19:08Z
Description
etcd (server/etcdserver/api/v3rpc/watch.go): StartRevision < 0 gets an immediate Created+Canceled response with WatchId=-1 and CancelReason=ErrCompacted; the watcher is never registered.

We only special-case nil/0 (app/etcd/watch.lua:268-284). A start_revision of -1 falls through to 'start_rev = start_rev - 1', and the compaction guard at :279 is gated on '> 0' so it skips the check entirely — the watcher registers with last_seen_revision = -2 and events_since (watch.lua:135,141-142) scans kv_history GE from -1, replaying all retained history. Neither wire validates (grpc.lua:424, json.lua:200).

Impact: a client passing WithRev(-1) gets a full-history flood instead of a cancel.
Acceptance criteria
start_revision < 0 returns created+canceled with cancel_reason set and registers no watcher, on both wires; a test pins -1 specifically.

Depends on

No outgoing dependencies.

Depended on by

Nothing depends on this issue.

No comments.

  • Eugene Blikh created the issue · 2026-07-17T16:19:07Z
  • Eugene Blikh added label etcd-changelog-sweep · 2026-07-17T16:19:07Z
Stored rows — what this pane was built from, as read
issues 1 row
id tarantool-etcd-agm
content_hash d4a2da2e9308e8a545805d7d930766b363bf014718142b5c35c99cc49a8e1940
title Negative Watch start_revision replays entire history instead of cancelling
description etcd (server/etcdserver/api/v3rpc/watch.go): StartRevision < 0 gets an immediate Created+Canceled response with WatchId=-1 and CancelReason=ErrCompacted; the watcher is never registered. We only special-case nil/0 (app/etcd/watch.lua:268-284). A start_revision of -1 falls through to 'start_rev = start_rev - 1', and the compaction guard at :279 is gated on '> 0' so it skips the check entirely — the watcher registers with last_seen_revision = -2 and events_since (watch.lua:135,141-142) scans kv_history GE from -1, replaying all retained history. Neither wire validates (grpc.lua:424, json.lua:200). Impact: a client passing WithRev(-1) gets a full-history flood instead of a cancel.
design
acceptance_criteria start_revision < 0 returns created+canceled with cancel_reason set and registers no watcher, on both wires; a test pins -1 specifically.
notes
status open
priority 1
issue_type bug
assignee NULL
estimated_minutes NULL
created_at 2026-07-17T13:19:08Z
created_by Eugene Blikh
owner bigbes@gmail.com
updated_at 2026-07-17T13:19:08Z
closed_at NULL
closed_by_session
external_ref NULL
spec_id
compaction_level 0
compacted_at NULL
compacted_at_commit NULL
original_size NULL
sender
ephemeral 0
wisp_type
pinned 0
is_template 0
mol_type
work_type
source_system
metadata <binary>
source_repo
close_reason
event_kind
actor
target
payload
await_type
await_id
timeout_ns 0
waiters
hook_bead
role_bead
agent_state
last_activity NULL
role_type
rig
due_at NULL
defer_until NULL
no_history 0
started_at NULL
is_blocked 0
labels 1 row
issue_id tarantool-etcd-agm
label etcd-changelog-sweep
events 2 rows
id 019f703b-1329-742e-9f2b-d5746c199d5c
issue_id tarantool-etcd-agm
event_type created
actor Eugene Blikh
old_value
new_value
comment NULL
created_at 2026-07-17T16:19:07Z
id 019f703b-1329-7a6f-bc22-0d5c0e1b851f
issue_id tarantool-etcd-agm
event_type label_added
actor Eugene Blikh
old_value NULL
new_value NULL
comment Added label: etcd-changelog-sweep
created_at 2026-07-17T16:19:07Z