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/garage: drop replication_mode setting #309643

Merged
merged 2 commits into from
May 13, 2024

Conversation

flokli
Copy link
Contributor

@flokli flokli commented May 6, 2024

This got broken up into separate replication_factor and consistency_mode settings with Garage 1.x, and due to the the "none" default kicking in, Garage fails to startup with

: Error: Either the legacy replication_mode or replication_level and consistency_mode can be set, not both.

if we actually make the migration as documented in the migration guide.

Drop this explicit setting, so users can set replication_mode or replication_factor/consistency_mode, depending on the version they're using.

With this PR, redeploying with the old key is a no-op (as expected), and I'm able to switch to replication_factor / consistency_mode.

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This got broken up into separate `replication_factor` and
`consistency_mode` settings with Garage 1.x, and due to the the "none"
default kicking in, Garage fails to startup with

> : Error: Either the legacy replication_mode or replication_level and consistency_mode can be set, not both.

if we actually make the migratiom as documented in the migration guide.

Drop this explicit setting, so users can set replication_mode or
replication_factor/consistency_mode, depending on the version they're
using.
@flokli flokli requested a review from yu-re-ka May 6, 2024 20:32
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels May 6, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels May 6, 2024
@yu-re-ka yu-re-ka force-pushed the garage-replication_mode branch from 8e87754 to 0837845 Compare May 13, 2024 07:31
@flokli
Copy link
Contributor Author

flokli commented May 13, 2024

@yu-re-ka thanks for the assertion ❤️

@yu-re-ka yu-re-ka force-pushed the garage-replication_mode branch from 0837845 to aa64bb2 Compare May 13, 2024 08:03
@flokli flokli merged commit c8b2579 into NixOS:master May 13, 2024
21 checks passed
@flokli flokli deleted the garage-replication_mode branch May 13, 2024 10:59
# because either replication_factor or replication_mode is required.
# This assertion can be removed in NixOS 24.11, when all users have been warned once.
{
assertion = (cfg.settings ? replication_factor || cfg.settings ? replication_mode) || lib.versionOlder cfg.package "1.0.0";
Copy link
Member

Choose a reason for hiding this comment

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

This should be

Suggested change
assertion = (cfg.settings ? replication_factor || cfg.settings ? replication_mode) || lib.versionOlder cfg.package "1.0.0";
assertion = (cfg.settings ? replication_factor || cfg.settings ? replication_mode) || lib.versionOlder cfg.package.version "1.0.0";

Copy link
Member

Choose a reason for hiding this comment

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

Created #311776

flokli added a commit that referenced this pull request May 15, 2024
…ng-tests

nixos/garage: reapply #309643, add assertion, fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants