affinity: resynchronize in-memory metadata after an ambiguous etcd transaction error

Aperta
#11,637 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start with runGroupOpsInTxn, CreateAffinityGroups, and UpdateAffinityGroupKeyRanges, then trace how affinity groups, keyRanges, and RegionLabeler are updated and how validateNoOverlapLocked checks them. Reproduce or study an ambiguous RunInTxn error where the transaction commits but returns an error; done means in-memory metadata reflects that transaction before subsequent requests are validated, so overlapping ranges are rejected.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

severity/minor type/bug

Bug Report

What did you do?

When CreateAffinityGroups or UpdateAffinityGroupKeyRanges executes a batch through runGroupOpsInTxn, an etcd transaction (RunInTxn) can commit on Raft while returning a client error (for example, context.DeadlineExceeded or a transport disconnect before the commit response arrives).

After #11501, runGroupOpsInTxn publishes the prefix of transactions whose commit calls returned nil and treats the transaction that returned an error as uncommitted.

What did you expect to see?

Before validating subsequent affinity group creations or key range updates, PD should ensure its in-memory affinity groups, keyRanges, and RegionLabeler rules reflect any transaction whose commit outcome was ambiguous, without waiting for a retry to overwrite the affected keys or for PD leadership to reload metadata.

What did you see instead?

Until a retry reapplies the affected operations or PD reloads metadata on restart or leader change, PD's in-memory state omits the changes from the ambiguous transaction. Because validateNoOverlapLocked checks incoming ranges against in-memory keyRanges, a subsequent request overlapping those persisted ranges can be accepted into storage.

Note: #11501 already ensures that persisted overlapping ranges do not block PD startup and automatically suspends affinity scheduling for conflicting groups (both on PD reload and via scheduling service watchers) until the overlap is repaired. This issue tracks recovering PD's in-memory metadata after an ambiguous transaction error so such overlaps are rejected up front.

What version of PD are you using (pd-server -V)?

master (with #11501, commit 207d8395269edc979b4111b3f4e0fdc858aa008d).

Lingua principale
Go
Stelle
1.2k
Fork
794
Merge medio
5g 32m
PR unite (30g)
81

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tikv/pd

Tutte le issue di tikv/pd

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.