Skip to content

Output files lose event-class StreamerInfos (UPDATE session on close wipes them) #568

@cmargalejo

Description

@cmargalejo

Summary

Every output file written by restManager is missing the StreamerInfos of the event classes it contains. Without them ROOT cannot apply schema evolution, so any change to an event class definition makes older files unreadable.

Mechanism

  1. Worker threads write events to temporary files; TRestRun::MergeToOutputFile merges them. The merged file at this point has all StreamerInfos.
  2. The same method then reopens the output in UPDATE mode to write metadata.
  3. On close, TFile::WriteStreamerInfo() (see ROOT TFile.cxx) frees the previous StreamerInfo record and writes only the classes streamed during the current session — i.e. only the metadata classes. The event-class infos are gone.

Verified with a minimal reproducer (write tree → infos present; TFileMerger → still present; reopen UPDATE + write a TNamed → event infos wiped). restG4 files are unaffected (single write session).

Consequences

Fix

PR #567 re-tags the existing infos after each UPDATE open so they are rewritten on close. Not covered there (lower risk, could be follow-ups): TFileMerger's own UPDATE path in MergeToOutputFile(outputfilename != ""), TRestAnalysisTree::AddChainFile, and the plot tools' UPDATE sessions (TRestMetadataPlot, TRestDataSetPlot). Read-only UPDATE sessions are safe (WriteStreamerInfo is a no-op unless something was streamed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions