Re-creating a destroyed array element by createhere: stale location entries misplace it and reject its epoch

Aperta
#4,031 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
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Start with CkArray::insertElement and its isRemote(idx) redirect, then CkLocCache::insert and the epoch check there, and reclaimRemote on the home side. Run tests/charm++/objid_insert (./objid_insert +p4 and +p4 -b) with phase 6 switched from createhome to createhere to reproduce both the misplacement and the epoch rejection. Done means the re-created element lands on the sending PE and later sends stop taking the detour, which the issue leaves to a design choice.

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

Descrizione

Found while extending tests/charm++/objid_insert for #4028; the defects predate the object id redesign and exist on main and reviewed-with-reconverse too. No application in the tree re-creates a destroyed element, so this is filed for the record, not as a blocker.

Scenario

Array element X lives on PE P. Other PEs have cached "X at P, epoch e". X is destroyed: P drops its record and tells the home, which erases its own cache entry but keeps the index-to-id binding (reclaimRemote). No other PE is told, so every other PE still holds "X at P, epoch e".

Later a [createhere] message for X is sent from PE B, so X should be re-created on B (the sending PE).

Defect 1: placement

CkArray::insertElement first asks isRemote(idx). B's stale entry says "at P", so B forwards the constructor message to P. The redirect exists for bound arrays, where a new element must be created where its sibling lives, but it cannot tell a live sibling from a stale entry for a dead element. The element is created somewhere other than B, or bounces.

Small fix: restrict the redirect to location managers that serve more than one array (bound arrays). For a single array, inserting an index that already lives elsewhere is a user error.

Defect 2: epoch

The re-created element registers with epoch 0 (createLocal default). Cache updates apply only when newer, so every PE holding the old entry keeps "X at P" and every later send takes the detour through P and the home; the repair it triggers carries epoch 0 and is rejected again. Delivery stays correct, the detour is permanent. In a debug build the creating PE asserts in CkLocCache::insert (epoch >= e.epoch) if it held the old entry itself.

For a packed-kind array the id is fixed by the index, so the re-created element reuses the id the stale caches know; a fresh id (possible for the hashed kind) does not cover it.

Proposed approach: lazy invalidation at load balancing

The home learns of every deletion. Keep the dead indices at the home and, at the next load-balancing step, when location updates are broadcast anyway, include "forget this id" entries, so every PE drops the stale entry and its epoch. Nothing is sent per deletion. Re-creation between a deletion and the next balancing step stays undefined until an application needs it.

Reproducer

tests/charm++/objid_insert phase 6 re-creates destroyed elements by createhome only; switching the re-creation to createhere shows both defects (the test header says so). Any build; ./objid_insert +p4 and +p4 -b.

Lingua principale
C++
Stelle
241
Fork
62
Merge medio
1g 1h
PR unite (30g)
121

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 charmplusplus/charm

Tutte le issue di charmplusplus/charm

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.