-
Notifications
You must be signed in to change notification settings - Fork 447
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
support --wal-dir in keeper #865
base: master
Are you sure you want to change the base?
Conversation
For those who run Postgres with a WAL directory symlinked to a separate disk (often for performance reasons) this commit adds a --wal-dir flag to the keeper. The symlink to a new WAL disk needs to be created as part of the database initialisation step, and also whenever we clobber the database, such as when taking a pg_basebackup (if pg_rewind is disabled/unavailable). By passing this directory as an argument to initdb and pg_basebackup, we can cover all the scenarios that the keeper erases and recreates the data directory, ensuring the symlink is always present. * Support waldir in pitr command For those who use different devices for wal and data directory, we should support the interpolation of the wal directory location in the pitr command as we do the data directory. This allows people to supply commands like: ``` pg_basebackup --pgdata %d --waldir %w ... ``` And have both data directory and wal directory templated. pg_basebackup and initdb are commands that support the concept of waldir, but this could be useful for any arbitrary pitr command. The commit also simplifies the implementation of the expand function to feature less mutation and slice offset accesses. * Also remove wal directory when destroying data If a wal directory is supplied then it's important to clean-out our wals along with our data directory. This commit renames the existing RemoveAll method to RemoveAllIfInitialized, which better represents what it does, and has it rely on a RemoveAll method that cleans-up both data directory and wal. Co-authored-by: Harry Maclean <[email protected]>
@sgotti , |
@sgotti , I think this is ready, but the agola test doesn't look too good. |
@sgotti this is ready to be merged. |
@sebasmannem Thanks. I'll take a look at this in the next days. In the meantime there're some lint errors on go1.16. For go 1.15 you're using a package not available in such version but I'll bump the go versions to the last two major versions in another PR. |
Thanks 🙏
Verstuurd vanaf mijn iPhone
… Op 24 mei 2022 om 09:17 heeft Simone Gotti ***@***.***> het volgende geschreven:
@sebasmannem Thanks. I'll take a look at this in the next days.
In the meantime there're some lint errors on go1.16. For go 1.15 you're using a package not available in such version but I'll bump the go versions to the last two major versions in another PR.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
@sgotti I intend to finalise this and my other commit over the next few weeks. |
Trying to get the --wal-dir option from #641 merged.