Overview of the Issue
GetTablets can misreport tablet type when filtering by --tablet-alias if the topology contains stale former primaries.
In the reproduced state, shard scoped GetTablets correctly reports the old tablets as unknown, but querying the same stale tablet by alias alone reports it as primary. Querying two stale tablet aliases from different shards together also makes the result depend on which stale record has the later primary_term_start_time, even though both should remain unknown relative to their own shards.
Reproduction Steps
mhamza15@c4c308a
Binary Version
Operating System and Environment details
Log Fragments
# Shard scoped truth for customer/-80
$ vtctldclient --server localhost:15999 GetTablets --keyspace customer --shard -80
zone1-0000000300 customer -80 unknown :0 :17000 [] 2026-04-16T13:31:18Z
zone1-0000000301 customer -80 primary vttablet301:15000 vttablet301:17000 [] 2026-04-16T13:32:02Z
zone1-0000000302 customer -80 rdonly vttablet302:15000 vttablet302:17000 [] <null>
# Shard scoped truth for customer/80-
$ vtctldclient --server localhost:15999 GetTablets --keyspace customer --shard 80-
zone1-0000000400 customer 80- unknown :0 :17000 [] 2026-04-16T13:31:19Z
zone1-0000000401 customer 80- primary vttablet401:15000 vttablet401:17000 [] 2026-04-16T13:33:02Z
zone1-0000000402 customer 80- rdonly vttablet402:15000 vttablet402:17000 [] <null>
# Single stale alias is misreported as primary
$ vtctldclient --server localhost:15999 GetTablets --tablet-alias zone1-0000000300
zone1-0000000300 customer -80 primary :0 :17000 [] 2026-04-16T13:31:18Z
# Two stale aliases from different shards interact across the request set
$ vtctldclient --server localhost:15999 GetTablets --tablet-alias zone1-0000000300 --tablet-alias zone1-0000000400
zone1-0000000300 customer -80 unknown :0 :17000 [] 2026-04-16T13:31:18Z
zone1-0000000400 customer 80- primary :0 :17000 [] 2026-04-16T13:31:19Z
Overview of the Issue
GetTabletscan misreport tablet type when filtering by--tablet-aliasif the topology contains stale former primaries.In the reproduced state, shard scoped
GetTabletscorrectly reports the old tablets asunknown, but querying the same stale tablet by alias alone reports it asprimary. Querying two stale tablet aliases from different shards together also makes the result depend on which stale record has the laterprimary_term_start_time, even though both should remainunknownrelative to their own shards.Reproduction Steps
mhamza15@c4c308a
Binary Version
Operating System and Environment details
Log Fragments