Commit Graph

327 Commits

Author SHA1 Message Date
Sveta Smirnova
465e22e9b5 Added hook for help output for new option in src/go/Makefile: build 2023-12-13 02:32:27 +03:00
Sveta Smirnova
22b96006db Merge branch '3.x' into galera-log-explainer 2023-11-30 20:12:22 +03:00
Sveta Smirnova
10b70206fb Merge branch '3.x' into PT-2281_provide_container_name_for_copying_files_in_the_dump 2023-11-30 19:37:36 +03:00
Artem Gavrilov
9272c9028c Merge pull request #713 from szepeviktor/patch-1
Fix MongoDB StorageEngine
2023-11-29 18:25:12 +02:00
Artem Gavrilov
ebb940f1af Merge pull request #714 from szepeviktor/patch-2
Fix MongoDB Security
2023-11-29 18:24:03 +02:00
Sveta Smirnova
43ae487f40 PT-2281 - provide container name for copying files in the dump
- Implemented error handling when container name is not specified
- Added test case for error handling
2023-11-29 05:06:27 +03:00
Sami Ahlroos
5e1dfaf218 build Go tools from top Makefile 2023-11-28 14:29:58 +02:00
Yoann La Cancellera
d82556e077 preallocate lastcontexts map 2023-11-24 10:25:22 +01:00
Yoann La Cancellera
400e343e73 Move: chan closing in "main" func 2023-11-24 10:22:29 +01:00
Sveta Smirnova
f3bd08ad0d Make OrderedBy not exported
- Updated orderedBy call
2023-11-23 22:14:35 +03:00
Yoann La Cancellera
7360c2dfcb Rename ctx to logCtx, remove any mention of ctx 2023-11-23 10:32:02 +01:00
Sveta Smirnova
db5289138f Merge pull request #715 from szepeviktor/patch-3
Fix variable collision with imported package name
2023-11-22 21:31:43 +03:00
Yoann La Cancellera
e3d48a0c6f Fix: missed errors, minor formatting issues 2023-11-22 11:00:53 +01:00
Yoann La Cancellera
304bc91b27 Imp: use strings.builder for conflicts 2023-11-22 09:33:49 +01:00
Sveta Smirnova
2ec78b3de4 Merge pull request #716 from szepeviktor/patch-4
Make OrderedBy not exported
2023-11-22 01:28:03 +03:00
Yoann La Cancellera
6cc6435bab Add: parallel on 2 unit tests 2023-11-21 18:33:37 +01:00
Yoann La Cancellera
923a199fb1 Update src/go/pt-galera-log-explainer/README.rst
Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
2023-11-21 16:18:53 +01:00
Yoann La Cancellera
6baca9310b Fix: README with -vvv, --grep-args, regex-list 2023-11-21 16:16:18 +01:00
Yoann La Cancellera
17c8026fde PR-669 - Add pt-galera-log-explainer percona#669
- Commented out whois command in README.rst
- Copied README.rst into docs directory, so user manual will include
  this tool
2023-11-21 16:10:27 +01:00
Yoann La Cancellera
2c9b853bbc Remove: --grep-args
Can be used to break the tool, and I actually never had an use-case
2023-11-21 16:01:12 +01:00
Yoann La Cancellera
ecf068ad90 Fix: typos 2023-11-21 15:57:15 +01:00
Viktor Szépe
81882b67cc fix 2023-11-21 02:41:26 +00:00
Viktor Szépe
c6b6a4086d Update src/go/lib/config/config_test.go
Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
2023-11-19 22:13:53 +01:00
Viktor Szépe
ed7f4b3e39 Update src/go/lib/config/config_test.go
Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
2023-11-19 22:13:47 +01:00
Viktor Szépe
61021d9ce6 Update src/go/lib/config/config_test.go
Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
2023-11-19 22:13:42 +01:00
Viktor Szépe
629ded3960 Make OrderedBy's return type exported 2023-11-17 20:47:54 +01:00
Viktor Szépe
1c5048546a Fix variable collision with imported package name 2023-11-17 20:38:08 +01:00
Viktor Szépe
2ea8f4036c Fix MongoDB Security 2023-11-17 20:34:35 +01:00
Viktor Szépe
65358b715f Fix MongoDB StorageEngine 2023-11-17 20:32:07 +01:00
Sveta Smirnova
b862945245 PT-2281 - provide container name for copying files in the dump
- Changed getIndividualFiles function and Dumper data structure, so we
  can specify container name for PXC and other operators which store
  logs in the separate container.
2023-11-14 16:55:56 +03:00
Yoann La Cancellera
7400fd876e Remove old comments, dead code 2023-11-13 21:31:22 +01:00
Sveta Smirnova
f9c43e9bae ARM64 support for macOS
- Added option darwin-arm64 into Go tools Makefile
- Changed --delimiter option to its short version that works on all
  platforms
- Changed "Mongo tools" comments to "Go tools", because now Go tools are
  not only for Mongo
2023-11-13 17:40:58 +03:00
Yoann La Cancellera
14b6a77d1e Add: translate tests 2023-11-07 18:08:51 +01:00
Yoann La Cancellera
602ca34006 Commenting out whois+sed, will be re-added later 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
230bece1e1 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-11-07 18:08:24 +01:00
Yoann La Cancellera
4c2272eff9 Add: inconsistent vote regex corner-case 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
978daa6eab Add: shortuuid check, new date layout found 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
478066d15b Add: same ip/name limitation on README.rst 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
f5d0ef77d1 Add: operator member assocations regex
It existed for non-operator setup, but was not working for operators due
to k8s logs not interpreting newlines and tabs
This operator version re-uses existing regular regex handlers directly
2023-11-07 18:08:24 +01:00
Yoann La Cancellera
41a593b294 Improve: main_test
It must test multiple times to remove doubts.
As the tool is reading files and relying on maps, their access order are
random. It can impact some translations
2023-11-07 18:08:24 +01:00
Yoann La Cancellera
ce6ea4e79c Remove: propagation of ip propagation to older hash, Add: operator regression test
When adding "ownip", it was also propagating the new IP to the old hash.
But with operators, when IP where changing hash will also change, so
linking the new IP to old hash is anachronic. It is not wrong, but
depending on the order of map merges, the newest information could have
been overriden depending on the order of events.

That situation was producing X(2*number of conflicts) versions of output for operators, with
different md5sum, which could produce false-positive regression tests

So currently some information are not linked anymore, so some IPs are
not translated even though they could, but it is a limitation of using
maps as source of truth, as they are not versioned
2023-11-07 18:08:24 +01:00
Yoann La Cancellera
208708a58b Add: concurrent SSTs handling
It is a thing: 2 nodes joining at the same time, with 2 JOINERs and 2
DONORs cluster-wide
It can happen on operators with 2 garbd joining at the same time

Before, pt-galera-log-explainer was using SST metadata naively.
Basically if a node was DONOR and we found a "transfer completed"
message, we assumed the donor name we found is the correct one.
So for concurrent SSTs, donors were swapping names.

Now, it is handled by a map, indexed by a donor name. To know if a node
is actual donor or not, it now compare timestamps of events. It assumes
both "selected donor" and "shifting DONOR" messages should have happen
in less than 0.01 secs to avoid any conflict.

Regression tests coming in next commit with an operator logs having
concurrent SSTs. Another conflicts was sometimes breaking the test
depending on the order on which we read files, hence why it's not added
here yet
2023-11-07 18:08:24 +01:00
Yoann La Cancellera
117d683872 Change: simplify verbose mode 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
161c2af084 Fix: pointer dereference if votes was missing 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
12ea8033a9 Add: proper error handling for files 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
b0477bc37f Fix: don't cut node name if it's an ip
rare case, but it was not producing great results
regression tests will come for this
2023-11-07 18:08:24 +01:00
Yoann La Cancellera
94c89c2892 Add: requirements in README.rst 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
72c55a15ec Remove: extra space in --version out 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
3ad09d8418 Update README.rst 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
a7a4b4adca Add: --no-color regression test 2023-11-07 18:08:24 +01:00