Skip to content

aodMerger: fail when the input or a copied tree is incomplete - #16187

Open
ktf wants to merge 2 commits into
AliceO2Group:devfrom
ktf:pr16187
Open

ktf wants to merge 2 commits into
AliceO2Group:devfrom
ktf:pr16187

Conversation

@ktf

@ktf ktf commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

A basket which cannot be read during a fast copy is not reported:
TTree::CopyEntries runs TTreeCloner with kNoWarnings, and the basket is
written with 0 bytes and the location of another branch's basket, its
branch left short of entries. The merger exited 0 and the file passed
validation. LHC25h3c/0/564414/AOD/1170/AO2D.root was merged this way
after an expired XRootD read: fIndexArray_Mothers of
DF_2424139774636032/O2mcparticle_001 lost its first basket, and ROOT
reads fIndexMcCollisions in its place.

An input which was not closed (a job which stopped while writing it)
has its keys recovered by ROOT, but its DF folders come back without
trees; merging it gave an AO2D without any DF folder, exit code 0.

After copying a tree, check that every branch has the entries of the
tree and every written basket a size and a location, count the ROOT
errors raised while copying it, and check GetEntry in the index loop.
Refuse an input whose keys had to be recovered and a DF folder without
trees. Any of these fails the merge with exit code 6 and removes the
output; the check for no DF merged no longer overrides an earlier code.

@ktf
ktf requested a review from a team as a code owner November 24, 2026 13:51
@ktf

ktf commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

@jgrosseo @costing While looking at the remaining errors when running with the new AODNative plugin, I discovered some silent failure mode for the AOD Merger when doing the fast copy. Can you cross check?

ktf added 2 commits November 24, 2026 15:11
Checks AO2D files, local or alien://, for what an interrupted write or
merge leaves behind, reading only the metadata (one read per tree):
- a file which was not closed (ROOT recovers its keys, but the DF
  folders come back without trees);
- a file with no DF folder, or a DF folder with no tree;
- a branch with fewer entries than its tree, or a basket with no size
  or location (a basket lost in a fast copy).
--deep also checks that the key of every basket belongs to its branch.
Exit code 0 if all files are fine, 1 if one has problems, 2 if one
cannot be read.
A basket which cannot be read during a fast copy is not reported:
TTree::CopyEntries runs TTreeCloner with kNoWarnings, and the basket is
written with 0 bytes and the location of another branch's basket, its
branch left short of entries. The merger exited 0 and the file passed
validation. LHC25h3c/0/564414/AOD/1170/AO2D.root was merged this way
after an expired XRootD read: fIndexArray_Mothers of
DF_2424139774636032/O2mcparticle_001 lost its first basket, and ROOT
reads fIndexMcCollisions in its place.

An input which was not closed (a job which stopped while writing it)
has its keys recovered by ROOT, but its DF folders come back without
trees; merging it gave an AO2D without any DF folder, exit code 0.

After copying a tree, check that every branch has the entries of the
tree and every written basket a size and a location, count the ROOT
errors raised while copying it, and check GetEntry in the index loop.
Refuse an input whose keys had to be recovered and a DF folder without
trees. Any of these fails the merge with exit code 6 and removes the
output; the check for no DF merged no longer overrides an earlier code.
@ktf ktf changed the title aodMerger: fail when a tree is not copied completely aodMerger: fail when the input or a copied tree is incomplete Nov 24, 2026
@jgrosseo

Copy link
Copy Markdown
Collaborator

@ktf Thank you for catching this case. I cannot validate this before I return from my trip.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants