Skip to content

Fix usage of pg_waldump --ignore option. #418

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

Merged
merged 2 commits into from
May 2, 2024

Conversation

lubennikovaav
Copy link

@lubennikovaav lubennikovaav commented Apr 29, 2024

Previously, the --ignore option was only used when reading from a single file.

With this PR pg_waldump -i is enough to open any neon WAL segments

Previously, the --ignore option was only used when reading from a single file.
@kelvich
Copy link

kelvich commented Apr 30, 2024

Let's add test with usage of pg_waldump on a first neon wal segment. IMO the easiest way would be to do that in neon repo python tests -- init empty database and check that waldump works on safekeeper wal. For all pg version.

Then it would be really easy to review this: some confirmation that this thing works and waldump is not on the critical path, so quick code read is enough

pg_fatal("could not stat file \"%s\"", fname);

/* Round up segment size to next power of 2 or 1MB */
WalSegSz = Max(next_pow2_int(stat.st_size), 1024 * 1024);

Choose a reason for hiding this comment

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

I do not understand the logic here: we get file size and then round it on power of two.
Either segment file has valid size and there is no need to align it, either it can bar smaller than segment size just because only some part of this segment was written, but in this case alignment on power of two will not help.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

This shouldn't be an issue for neon, because we always write full segment, even for our special segment 0.

@lubennikovaav lubennikovaav merged commit 8ef3c33 into REL_16_STABLE_neon May 2, 2024
@lubennikovaav lubennikovaav deleted the waldump_ignore_errors_v16 branch May 2, 2024 09:51
tristan957 pushed a commit that referenced this pull request May 10, 2024
Previously, the --ignore option was only used when reading from a single file.
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.

4 participants