With a shared --index-dir, dftracer_server treats other datasets' indexed files as removed and deletes the index
Symptom#
Serving one dataset with an explicitly shared dftracer_server --index-dir deletes the indexes of other datasets that share that directory.
Cause#
With --index-dir set, all discovered paths map to one index root (dftracer_server.cpp:29-79, composites/dft/internal/utils.cpp:10-18). find_stale_files marks every indexed logical path missing from current_paths as removed (index_database.cpp:706-741), and stale() includes removed (index_database.h about line 130). TraceIndex::initialize then removes the whole root (trace_index.cpp:75-80).
Fix#
Not applied when this was found. Staleness must be judged only against the files of the dataset being served, or a shared root must never be removed whole.
Evidence#
A review agent read the code of the PR 96 head (llnl-asr/dftracer-utils) and confirmed it. No run reproduced it.
Also found by searching
- dftracer_server --index-dir /shared deleted the index for another dataset
- serving one dataset wipes indexes of other datasets in the same index directory
- can several datasets share one dftracer_server index directory safely
- find_stale_files marks other datasets' paths removed, remove_all on shared index root
- dftracer_server --index-dir shared by two datasets, serving one deleted the other's index
- indexes for other datasets vanish when I start dftracer_server with the same --index-dir
- why does a shared index directory get removed whole when serving a single dataset?
- find_stale_files marks missing logical paths removed, TraceIndex::initialize remove_all, shared index root