[9.4](backport #51591) remove global paths from metricbeat#51778
Conversation
* remove global paths from metricbeat * x-pack/metricbeat/sql: migrate cursor tests off the global paths singleton --------- Co-authored-by: Orestis Floros <orestis.floros@elastic.co> (cherry picked from commit 37f3d26) # Conflicts: # metricbeat/mb/builders.go # x-pack/libbeat/cmd/instance/beat.go # x-pack/metricbeat/module/sql/query/query_test.go
|
Cherry-pick of 37f3d26 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
🤖 GitHub commentsJust comment with:
|
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
TL;DRBoth failed Buildkite jobs stopped in Remediation
Investigation detailsRoot CauseThis is a backport conflict, not a flaky test or infrastructure issue. The Buildkite pre-commit hook found literal merge-conflict markers in the PR head:
The incoming change also references the newer Evidence
The PR head also shows VerificationNot run locally: the failure is fully explained by the pre-commit merge-conflict check and the PR ref content, and the local workspace is not checked out at the PR head. What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
Proposed commit message
This change removes the use of global/singleton path state from Metricbeat and replaces it with per-instance paths, fixing a bug where multiple Metricbeat receivers could share the same data store.
Problem
Metricbeat was using global paths.Paths (a package-level singleton) when resolving file paths like the SQL cursor data store. In receiver mode, multiple Metricbeat instances share the same process, so they would all resolve to the same data path, causing them to share state incorrectly.
Changes
Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
None. Stand alone Metricbeat will function as before, only metricbeat receiver will have multiple beat instances in the same process. This change will allow the sql module to have unique data path per beat instance.
How to test this PR locally
Related issues
Use cases
Screenshots
Logs
This is an automatic backport of pull request #51591 done by [Mergify](https://mergify.com).