Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to change in error case behavior. #1226

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pcanal
Copy link
Member

@pcanal pcanal commented Nov 22, 2024

This is chained on #1224 and is the companion PR to root-project/root#17009

Instead of writing with the 'wrong' TStreamerInfo, the hadd of two file with conflicting StreamerInfo
with the same version number write with the 'right' StreamerInfo ... but that StreamerInfo has
missing fields with are now omitted in the writing.

The use case has 2 StreamerInfos:
(a)
v10 of ParticleImplVec
which inherits from v11 of Particle
which contains 3 floats

(b)
v10 (also) of ParticleImplVec
which inherits from v12 of Particle
which contains a float and moves the 3 pre-existing float into a base
class (so they are 'missing' when using v11 of Particle).

The previous behavior of the hadd invocation was streaming
   v10-a of ParticleImplVec
but ended up continuing the streaming with
   v12 of Particle

Now the hadd invocation is still streaming
   v10-a of ParticleImplVec
but is continuing with streaming with its corresponding
   v11 of Particle
which has missing data member (those moved in the base)
so during Streaming we could either write arbitrary values (0)
or (the choice that is made) we just skip them leading to a more
clear error at read time:

```
Error in <TBufferFile::CheckByteCount>: object of class vector<ParticleImplVec> read too many bytes: 56 instead of 8
```

Note that the `56` is actual another consequence of the 'broken' setup
in which hadd had to run (duplicate version number) and the reading
is incorrectly trying to read with version 12 of Particle.

Reminder: the point of these tests is to ensure that there is
sufficient error output is case of this type of mixed up setup.
You can now create a symlink or subdirectory called ArchivedDataFiles.
You can also set the environment variable ROOT_NEWSTL_DATAFILE_DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants