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

nixos/pgbackup: Fix and refactor the postgres backup module #42133

Merged
merged 3 commits into from Jun 20, 2018

Conversation

markuskowa
Copy link
Member

Motivation for this change

Fix the postgresqlBackup module. At least in NixOS 18.03 the backup is broken, delivering empty backup files quietly (#41388).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Jun 19, 2018

@GrahamcOfBorg test postgresql

@GrahamcOfBorg
Copy link

Success on aarch64-linux

Attempted: tests.postgresql

No partial log is available.

@GrahamcOfBorg
Copy link

Success on x86_64-linux

Attempted: tests.postgresql

No partial log is available.

@@ -28,9 +51,9 @@ in
};

period = mkOption {
default = "15 01 * * *";
default = "*-*-* 01:15:00";
Copy link
Member

@Mic92 Mic92 Jun 19, 2018

Choose a reason for hiding this comment

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

Maybe we should rename this option? The type of both is string old values could break silently. Renaming the option would make this more obvious since the format is different.

Copy link
Member

Choose a reason for hiding this comment

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

startAt could be alternative.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that seems more natural in the new version

@@ -50,10 +50,10 @@ in {
'';
};

period = mkOption {
startAt = mkOption {
Copy link
Member

Choose a reason for hiding this comment

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

Adding:

(mkRemovedOptionModule [ "services" "postgresqlBackup" "period" ] "A systemd timer is now used instead of cron. The starting time can be configured via services.postgresqlBackup.startAt")

modules/rename.nix would make sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK. Do we need to also mention the change in the release notes?

Copy link
Member

Choose a reason for hiding this comment

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

Probably not, the error message generated from mkRemovedOptionModule should be self-explanatory.

@Mic92 Mic92 merged commit d63cb06 into NixOS:master Jun 20, 2018
@markuskowa markuskowa deleted the pgbackup branch June 20, 2018 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants