Commit Graph

4948 Commits

Author SHA1 Message Date
Yoann La Cancellera
84dcf1ef9c Commenting out whois+sed, will be re-added later 2023-12-29 17:19:24 +03:00
Yoann La Cancellera
c910c35d3e 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-29 17:19:24 +03:00
Yoann La Cancellera
ea262eff27 Add: inconsistent vote regex corner-case 2023-12-29 17:19:24 +03:00
Yoann La Cancellera
580ccb7428 Add: shortuuid check, new date layout found 2023-12-29 17:19:24 +03:00
Yoann La Cancellera
3eaf60bd88 Add: same ip/name limitation on README.rst 2023-12-29 17:19:24 +03:00
Yoann La Cancellera
7513e1ded7 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-12-29 17:19:24 +03:00
Yoann La Cancellera
d13292ba67 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-12-29 17:19:24 +03:00
Yoann La Cancellera
c67047e781 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-12-29 17:19:01 +03: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
Yoann La Cancellera
6613880a9b Change: README to pt standard, regex-list --json 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
0d554e9515 Add: merge regression tests 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
75ce300d7c Fix: "not found" should not be an error
if it shows nothing, it can be understood as easily as a grep returning
nothing
adding an error log is too verbose
2023-11-07 18:08:24 +01:00
Yoann La Cancellera
fea9be26bd Add: regression tests 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
6d6f30372c Fix: error msg with uppercase, usage missed pt- 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
5638387713 Fix: --version formatting 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
bbba087a83 Fix: crash when timeline is empty
It was due to a silly regression when reformatting the main.go
The function iterating was doing too many things, and returning an error
when nothing was found, and a "continue" was done on the main
"timelineFromPaths" loop
It is now a simple foreach loop that does not return error so we have to
check if the localtimeline slice is empty
2023-11-07 18:08:24 +01:00
Yoann La Cancellera
7f8071ce3f Simplified the main loop 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
5bbb11df17 Add: merge by directory, Simplified: timeline merges 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
e03fe1801c Fix: forgot to inherit conflicts 2023-11-07 18:08:24 +01:00
Yoann La Cancellera
b054429057 Improve: "not found" error handling 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
Sveta Smirnova
62d7c70c43 Release v3.5.5 (#692)
* PT-2255 Release notes for Percona Toolkit version 3.5.5
	modified:   Makefile.PL
	modified:   config/sphinx-build/conf.py
	modified:   docs/release_notes.rst

* PT-2255 Release notes for Percona Toolkit version 3.5.5

- Added missed contributions

* PT-2255 Release notes for Percona Toolkit version 3.5.5

- Added PT-2258

* Changelog for version 3.5.5

Added Changelog, updated version

* Fix version (#690)

* Release 3.5.5

- Updated Go version to 1.21

* Update go.mod

---------

Co-authored-by: Alina Derkach <alina.derkach@percona.com>
Co-authored-by: EvgeniyPatlan <evgeniy.patlan@percona.com>
2023-10-03 17:58:02 +03:00
Sveta Smirnova
d4ec358f35 Update toolkit.yml (#693) 2023-10-03 17:54:00 +03:00
Alina Derkach
d911525b13 PT-2255 Release notes for Percona Toolkit version 3.5.5 (#679)
* PT-2255 Release notes for Percona Toolkit version 3.5.5
	modified:   Makefile.PL
	modified:   config/sphinx-build/conf.py
	modified:   docs/release_notes.rst

* PT-2255 Release notes for Percona Toolkit version 3.5.5

- Added missed contributions

* PT-2255 Release notes for Percona Toolkit version 3.5.5

- Added PT-2258

* Update the release date in release_notes.rst

---------

Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
2023-10-03 16:31:54 +03:00
Sveta Smirnova
df73533d29 Changelog for v3.5.5 (#684)
* PT-2255 Release notes for Percona Toolkit version 3.5.5
	modified:   Makefile.PL
	modified:   config/sphinx-build/conf.py
	modified:   docs/release_notes.rst

* PT-2255 Release notes for Percona Toolkit version 3.5.5

- Added missed contributions

* PT-2255 Release notes for Percona Toolkit version 3.5.5

- Added PT-2258

* Changelog for version 3.5.5

Added Changelog, updated version

* Update Changelog

Co-authored-by: Alina Derkach <alina.derkach@percona.com>

---------

Co-authored-by: Alina Derkach <alina.derkach@percona.com>
2023-10-03 16:29:53 +03:00
Sveta Smirnova
46fd033994 PT-2258 - Pass tbl as argument for on_copy_rows_after_nibble (#682)
- Implemented the feature
- Created test case
v3.5.5
2023-09-22 13:35:29 +03:00
Sveta Smirnova
d71ac56f14 Merge CONTRIBUTE.md and CONTRIBUTING.md (#683)
- These two files exist for the same purpose but have different content
  that could confuse users. Better to keep only CONTRIBUTING.md with all
details, related to contributions.
2023-09-21 16:23:19 +03:00
Sveta Smirnova
f8c43118bd PT-2168 pt-osc shouldnt fail while unable to monitor a replica node (#676)
* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Proof of concept
- Fixed regular expression in lib/TableParser.pm mistakenly chaged in the tool's code

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Added basic test case for PT-2168
- Added more details for replica lag information
- Disconnecting replica if lag is not checked. This prevents "Too many
  connections" error

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Implemented option --wait-lost-replicas for pt-osc, added test case

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Added more tests for situations where connection to the replica can
  fail

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Removed extra checks for wait_no_die variable
- Added test cases for SQL queries that pt-osc sends to replicas

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Allow to reload dsns table while waiting for missed replica if
  --recursion-method is dsn
- Fixed logic in replica rediscovery, so it works with replicas on the
  same host but with different ports
- Renamed option wait-lost-replicas to fail-on-stopped-replication, so
  it is in line with pt-table-checksum
- Adjusted tests
- Removed debug code for PT-1760
- Added test case for PT-1760
- Added exception for variable Open_tables_with_triggers in
  lib/bash/collect.sh due to failed test in Percona Server 8.0.34+
- Updated pt-stalk

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Updated modules
- Fixed typo in t/pt-table-sync/bidirectional.t
- Removed trailing whitespaces in lib/MasterSlave.pm

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Help for option --fail-on-stopped-replication

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Added check for availability of the simple_rewrite_plugin in t/pt-online-schema-change/pt-2168.t

* PT-2168 - PT-OSC shouldn't fail while unable to monitor a replica node

- Added link to the simple_rewrite_plugin source code
- Removed tests for code that runs only in the beginning of pt-osc
  action, so should not be affected by the option fail-on-stopped-replication
2023-09-19 23:31:33 +03:00
dependabot[bot]
36a183e2aa Bump k8s.io/api from 0.28.1 to 0.28.2 (#680)
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.28.1 to 0.28.2.
- [Commits](https://github.com/kubernetes/api/compare/v0.28.1...v0.28.2)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-18 17:14:51 +03:00
Viktor Szépe
d01c0cea32 Fix last typos (#678) 2023-09-18 15:53:57 +03:00
Viktor Szépe
275af2a886 Ignore Typos false positives (#671) 2023-09-15 17:39:06 +03:00
Viktor Szépe
f2f7a7993d Add final newlines and remove trailing spaces (#672)
* Add final newlines and remove trailing spaces

* Replace TAB characters with spaces

* Fix indent
2023-09-15 17:31:40 +03:00
dependabot[bot]
c20d1c40c7 Bump actions/upload-artifact from 3.1.2 to 3.1.3 (#673)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3.1.2...v3.1.3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-15 17:28:47 +03:00
dependabot[bot]
95ab0d9e07 Bump actions/checkout from 3 to 4 (#674)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-15 17:28:27 +03:00
IT @ Percona
c82e3fa435 Update .whitesource (#677) 2023-09-15 17:27:57 +03:00
Sveta Smirnova
cd727bf9af PT-2248 - pt-k8s-debug-collector does not run pg_gather with K8SPG 2 (#654)
* PT-2248 - pt-k8s-debug-collector does not run pg_gather with K8SPG 2

- Added check for K8SPG 2, so can run pg_gather for it
- Added new allowed value for option --resource:
-- pgv2 for K8SPG 2
-- auto to auto-detect custom resource
- Option --resource has now default value "auto"
- Updated documentation
- Added test cases for new options

* PT-2248 - pt-k8s-debug-collector does not run pg_gather with K8SPG 2

- Implemented custom user and secrets handling (in case when no default
  user exists).
2023-09-13 15:11:04 +03:00
dependabot[bot]
77378331e2 Bump golang.org/x/crypto from 0.12.0 to 0.13.0 (#675)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.12.0 to 0.13.0.
- [Commits](https://github.com/golang/crypto/compare/v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 02:11:29 +03:00
Viktor Szépe
2bd40d8c39 Remove trailing spaces (#665)
* Remove trailing spaces

* PR-665 -  Remove trailing spaces

- Updated not stable test t/pt-online-schema-change/preserve_triggers.t
- Updated utilities in bin directory

* PR-665 -  Remove trailing spaces

- Fixed typos

* PR-665 -  Remove trailing spaces

- Fixed typos

---------

Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
2023-09-06 01:15:12 +03:00
dependabot[bot]
8bf97c9ca7 Bump aquasecurity/trivy-action from 0.11.2 to 0.12.0 (#670)
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.11.2 to 0.12.0.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/0.11.2...0.12.0)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 16:27:56 +03:00
Artem Gavrilov
ab741852bf Merge pull request #667 from percona/dependabot/go_modules/k8s.io/api-0.28.1
Bump k8s.io/api from 0.27.4 to 0.28.1
2023-09-05 14:41:49 +02:00
Artem Gavrilov
e4c63be106 Merge pull request #666 from percona/dependabot/go_modules/github.com/google/uuid-1.3.1
Bump github.com/google/uuid from 1.3.0 to 1.3.1
2023-09-05 14:41:16 +02:00
Viktor Szépe
a8fcc551a6 Add spelling workflow (#663)
* Add spelling workflow

* Revert pt-mongodb-query-digest README

* Fix another typo
2023-09-05 15:39:24 +03:00