Skip to content

Commit f3996aa

Browse files
xiaocai2333claude
andcommitted
Name the collision: two messages, one name
The pin cited etcdpb.CollectionShardInfo without saying it is a different message from this one. They share a name -- one in the collection meta with a single truncate tick, introduced by the truncate API and on master today; this one new here with four fields -- so a reader takes the sentence as self-reference and the pin as arbitrary. It is not: the collection meta swaps that message for this one at the same field number, and records written before the swap must still decode. Said outright now, collision included. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
1 parent 14f89bb commit f3996aa

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

go-api/schemapb/schema.pb.go

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/schema.proto

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -591,13 +591,14 @@ enum ShardState {
591591
// and that belongs to the split task, which ends; the shards do not.
592592
message CollectionShardInfo {
593593
// The time tick this shard's WAL is truncated up to, 0 if never. Unrelated to
594-
// routing, and older than it: the truncate API already kept a per-shard
595-
// record next to the vchannel list, as etcdpb.CollectionShardInfo with this
596-
// one field. This message replaces that one, adding the state and predicate a
597-
// split needs beside the truncate tick that was already there.
594+
// routing, and older than it.
598595
//
599-
// Which is why the number must stay 1 -- it decodes the bytes that record
600-
// already persisted.
596+
// The truncate API already kept a per-shard record beside the vchannel list,
597+
// in a SEPARATE message that happens to share this one's name --
598+
// etcdpb.CollectionShardInfo, holding this field and nothing else. The
599+
// collection meta swaps that message for this one at the same field number,
600+
// so records written before the swap must still decode: hence field 1 here
601+
// is that same truncate tick, and cannot be renumbered.
601602
uint64 last_truncate_time_tick = 1;
602603
ShardState state = 2;
603604
// The shard's own vchannel, so a consumer can key by it rather than by

0 commit comments

Comments
 (0)