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

On-demand WAL download in create logical replication slot #8931

Closed
Tracked by #6213
ololobus opened this issue Sep 5, 2024 · 2 comments
Closed
Tracked by #6213

On-demand WAL download in create logical replication slot #8931

ololobus opened this issue Sep 5, 2024 · 2 comments
Assignees

Comments

@ololobus
Copy link
Member

ololobus commented Sep 5, 2024

We have 3 open PRs to all Postgres versions

All are approved, so let's properly merge and bump submodule versions

Heikki also mentioned the tests' absence (can we write some?) and other discrepancies https://neondb.slack.com/archives/C04DGM6SMTM/p1725445174109119?thread_ts=1724867700.274789&cid=C04DGM6SMTM

@knizhnik
Copy link
Contributor

knizhnik commented Sep 9, 2024

There 5 where now we install our on-demand download functions:
3 times this set of functions is replaced:

       xlr.page_read = read_local_xlog_page;
	xlr.segment_open = wal_segment_open;
	xlr.segment_close = wal_segment_close;

and two times this set of function is replaced:

xlr.page_read = logical_read_xlog_page;
xlr.segment_open = WalSndSegmentOpen;
xlr.segment_close = wal_segment_close;

Where are using three different callbacks for it: SlotFuncs_Custom_XLogReaderRoutines, WalSender_Custom_XLogReaderRoutine and LogicalFuncs_Custom_XLogReaderRoutines all of which are not install the same set of functions:

	xlr->page_read = NeonWALPageRead;
	xlr->segment_open = NeonWALReadSegmentOpen;
	xlr->segment_close = NeonWALReadSegmentClose;

All this contexts are passed to CreateInitDecodingContext and CreateDecodingContext which in turn call StartupDecodingContext.

I wonder if we should define just one callback and call it from StartupDecodingContext.

knizhnik added a commit that referenced this issue Nov 19, 2024
…tartupDecodingContext (#9007)

## Problem

See #8931
On-demand WAL download are not set in all cases where WAL is accessed by
logical replication

## Summary of changes

Set customer xlog reader handles in StartupDecodingContext

Related changes in Postgres modules:

neondatabase/postgres#495
neondatabase/postgres#496
neondatabase/postgres#497
neondatabase/postgres#498

## Checklist before requesting a review

- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
- [ ] Do we need to implement analytics? if so did you add the relevant
metrics to the dashboard?
- [ ] If this PR requires public announcement, mark it with
/release-notes label and add several sentences in this section.

## Checklist before merging

- [ ] Do not forget to reformat commit message to not include the above
checklist

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
@ololobus
Copy link
Member Author

Looks like all PRs have been merged, slosing

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

No branches or pull requests

2 participants