Commit Graph

7 Commits

Author SHA1 Message Date
Yoann La Cancellera
3bdc4b95ba pt-galera-log-explainer: refactor conflict response 2024-01-26 12:25:45 +01:00
Yoann La Cancellera
97cc3ebb01 PT-2298 pt-galera-log-explainer superfluous lines on conflicts 2024-01-08 18:37:57 +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
Yoann La Cancellera
e56fc45a05 Add: inconsistent vote regex corner-case 2023-12-22 23:10:08 +03:00
Yoann La Cancellera
161c2af084 Fix: pointer dereference if votes was missing 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
b4cad31e77 Add pt-galera-log-explainer 2023-11-07 18:08:19 +01:00