Commit Graph

5 Commits

Author SHA1 Message Date
Sveta Smirnova
a62d1b2ba9 Update copyright year to 2026
- Updated copyright years for Go tools
2026-01-31 03:59:46 +03:00
Sveta Smirnova
a875953118 Update copyright year to 2026
- Added license header into Go files
2026-01-30 19:05:19 +03:00
Yoann La Cancellera
6636265ef2 pt-galera-log-explainer: fixes: operator identity, keeping oldest
translations, avoiding unspecified names loops for whois command

Those bugs were not breaking behavior, but they were causing variations
of results. It would not always store the same timestamps, sometimes breaking
tests
Most of the random come from regex map iteration
2024-03-18 18:19:52 +01:00
Yoann La Cancellera
955fd75ca9 Rename ctx to logCtx, remove any mention of ctx 2023-12-22 23:10:34 +03:00
Yoann La Cancellera
2091c1a1f0 Refactoring: migrate translations to singleton
It was using maps in each context, which would be merged between
contexts, then injected each time we needed a message to display.

It had a limitation on complicated operator setups: historical
information would be overriden by newer associations.
(e.g, that IP was for node0 yesterday, now it's node1, so associations
have been overwritten and incorrect)

It also introduced complexity, such as forcing to define closures too
many times, merging maps, it would be harder to debug, and every files
were starting from empty translation maps.
Moreover, iterating on maps is guaranteed to be random so it could create
hard-to-debug output variations on complex cases.

Now it is a singleton in translate package, still using maps but now it
associates an array of "units" storing the timestamp with each piece of information.
It is protected by rwmutex, because map are not threadsafe. (there's no
parallel processing for now)

No regressions, and it passes "operator_ambiguous_ips_list_all_no_color"
where the old system failed.
It nows also can be used as an easy to read source of information in
itself
2023-12-22 23:10:32 +03:00