Skip to content

chore: implement functionality to allow overriding logical time extraction during import - #70

Open
doudou wants to merge 5 commits into
masterfrom
logical_time_override
Open

chore: implement functionality to allow overriding logical time extraction during import#70
doudou wants to merge 5 commits into
masterfrom
logical_time_override

Conversation

@doudou

@doudou doudou commented Aug 6, 2026

Copy link
Copy Markdown
Member

This PR is meant to allow importing datasets that have problems.

With the addition of the extraction of logical time from the samples, we can have issues with non-monotonic times. Or we can find out that some samples do not have logical time fields but should.

This PR implements having a config file that allows overriding the logical time field (or removing it altogether if needed) to fix the import of such datasets. Moreover, it checks that the log file's rt/lg fields are monotonic to avoid generating invalid log files.

The config file's schema is documented (and internally validated) as json-schema

@doudou
doudou requested a review from jhonasiv August 6, 2026 00:45
@doudou
doudou force-pushed the logical_time_override branch 2 times, most recently from 4bb044b to 1d2093b Compare August 6, 2026 14:40
doudou added 4 commits August 6, 2026 17:24
…ence

So far, we were relying on Rock's logger::Logger being a "known quantity", that
is being sure that the sample time's would be monotonic. Note that the logger's
behaviour is not generally ideal:
1. a sample's realtime is the Time::now() time where it is being logged
2. a sample's logical time is the Time::now() when the logger was woken up for
   that particular sample

Under load, it means that a few samples can actually have the same logical time.
This is actually why this commit allows equal rt/lg times (since rock's
base::Time has a microsecond resolution, we might sometime get some equality as
well)

However, monotonic time is not guaranteed anymore with the extraction of logical
time from samples. We could get bugs that cause older samples to be logged again
(actually happened), or the component(s) might be buggy themselves.

If some components are badly written, the resulting stream might end up being
simply invalid (and tooling would fail)

This commit validates that all times are in sequence, rejecting samples if it is
not the case. It maintains stream statistics, that get reported at the end of
the stream importation, to not "hide" that fact.
…ig file

One more refactor of the config file structure, but that's worth it.
@doudou
doudou force-pushed the logical_time_override branch from 1d2093b to ee38b20 Compare August 6, 2026 20:25
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.

1 participant