Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PG-934 Fix old telemetry files loading on startup #10

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

artemgavrilov
Copy link
Collaborator

@artemgavrilov artemgavrilov commented Jul 31, 2024

PG-934

There were two problems:

  1. cleaup_telemetry_dir was trying to load old telemetry filenames, but instead of full file paths, it loaded only filenames. So it wasn't able to remove actual files from filesystem on cyclic buffer wraparound.
  2. When cleaup_telemetry_dir read files from directory it doesn't consider that ReadDir may (and will) returns files in non-alphabetical order. So files were loaded in wrong order in cyclic buffer.

P.S. I renamed cleaup_telemetry_dir to load_telemery_files because its purpose not to cleanup dir, but load old files with respect of the limits.

@artemgavrilov artemgavrilov marked this pull request as ready for review July 31, 2024 19:09
@artemgavrilov artemgavrilov requested a review from codeforall July 31, 2024 19:09
Copy link

@darkfronza darkfronza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a small comment.

percona_pg_telemetry.c Outdated Show resolved Hide resolved
Copy link

@codeforall codeforall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@artemgavrilov artemgavrilov changed the base branch from main to bugfixes August 2, 2024 13:38
@artemgavrilov artemgavrilov merged commit b7dffc7 into bugfixes Aug 2, 2024
6 checks passed
@artemgavrilov artemgavrilov deleted the PG-934-files-to-keep-fix branch August 2, 2024 13:39
artemgavrilov added a commit that referenced this pull request Aug 12, 2024
* PG-934 Fix old telemetry files loading on startup

* PG-934 Fix build for PG12

* PG-934 Fix codestyle

* PG-934 Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants