mkGteRange passed a zero-length but non-nil range end through unchanged,
and the MVCC index served it as an open-ended range, while the auth
check treats a zero-length range end as a single key. A non-nil empty
range end can reach it from a hand-crafted request on branches whose
protobuf decoder keeps a present-but-empty field as []byte{}, or from
an in-process caller on any branch.
Normalize a zero-length range end to nil so the logic is correct
regardless of the decoder. "\x00" still maps to []byte{} (the >= key
form).
Signed-off-by: Gaurav Pande <garvpande11235@gmail.com>
put looks up the key at beginRev+1 even before the first change in
the txn. The current index returns the same result as a lookup at
beginRev. We should not rely on how the index handles future
revisions.
Use beginRev before the first change and beginRev+1 after it, just
like Range and deleteRange do.
Fix the TestStorePut case where the fake index had a key newer than
the store revision.
Add TestTxnReadOwnRevision to check that a txn can read its own write.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Verify compaction through Compact, Keep, and Revisions instead of tree
equality, and remove the unused equality methods.
Use a real index in TestStoreRestore and fix the fixture's backend
revision to match its create and modification revisions. This mismatch
was introduced by ecba9b61cf ("storage: start initial revision at 1").
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Buffer-full drops only mean an in-process channel is full, not a
kernel/network failure. peer.go already omitted the suffix; align
stream.go and remote.go.
Signed-off-by: Swapnil <shendeswapnil.6@gmail.com>
etcd 3.5 and earlier could persist v2 metadata requests (member
attribute updates and cluster version updates) to the WAL. The v2
store has been removed, so replaying such entries panics. Drop only
those two expected shapes and panic on anything that is neither a
valid InternalRaftRequest nor one of them: WAL corruption must fail
loudly, not be silently ignored. Mirror the release-3.6 behaviour in
the WAL version detection, which surfaces the original decode error
for unparseable entries instead of skipping them.
The legacy v2 request detection lives in the new internal package
server/internal/legacyv2, shared by the apply path and the WAL
version detection.
Signed-off-by: NUAAwqy <146524024+NUAAwqy@users.noreply.github.com>
Go 1.27.3 was released and contains a fix for CVE-2026-111943. Per the
project's dependency management guidance we track the latest patch release,
so bump the toolchain directive in every module and the .go-version file
from 1.27.2 to 1.27.3.
This covers the `main` branch item of #22628.
Signed-off-by: Batianxieshen1 <280706568+Batianxieshen1@users.noreply.github.com>
processMessages walks Ready messages last to first so it can keep only the newest MsgAppResp. Since #21810 and #21778 it appends survivors during that walk, so MsgApp leaves the leader in reverse log order. Followers reject those appends and the leader resends.
Keep the same filter and return survivors in Ready order, without modifying the Ready messages. TestProcessMessagesOrder now expects the same order as release-3.6.
Fixes#22483
Signed-off-by: Ričardas Čubukinas <29689012+xadips@users.noreply.github.com>
Record the order in which processMessages returns Ready messages. It is currently reversed relative to the Ready order.
Part of #22483
Signed-off-by: Ričardas Čubukinas <29689012+xadips@users.noreply.github.com>
Clone the last key before appending \x00 so concurrent keys-only streams do not modify the shared key in the index.
Signed-off-by: Jefftree <jeffrey.ying86@live.com>