mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
nixos: fix services.foundationdb.traceFormat for older server versions
This was a testing oversight that came from #61009 -- I forgot to test the new traceFormat option with older server versions while I was working on FDB 6.1. Since trace_format is only available in 6.1+, emitting it unconditionally caused older versions of the database fail to start, reporting an error. We simply gate it behind a version check instead, and assert the format is always XML on older versions. This avoids the case where the user has an old version, changes traceFormat willingly, and then is confused by why it didn't work. As reported by @TimothyKlim in the comments on commitc55b9236f0
. Seec55b9236f0 (r33566132)
Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
parent
9aa6837853
commit
e2bbc6fb46
1 changed files with 12 additions and 0 deletions
|
@ -35,7 +35,10 @@ let
|
|||
${optionalString (cfg.class != null) "class = ${cfg.class}"}
|
||||
memory = ${cfg.memory}
|
||||
storage_memory = ${cfg.storageMemory}
|
||||
|
||||
${optionalString (lib.versionAtLeast cfg.package.version "6.1") ''
|
||||
trace_format = ${cfg.traceFormat}
|
||||
''}
|
||||
|
||||
${optionalString (cfg.tls != null) ''
|
||||
tls_plugin = ${pkg}/libexec/plugins/FDBLibTLS.so
|
||||
|
@ -327,6 +330,15 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{ assertion = lib.versionOlder cfg.package.version "6.1" -> cfg.traceFormat == "xml";
|
||||
message = ''
|
||||
Versions of FoundationDB before 6.1 do not support configurable trace formats (only XML is supported).
|
||||
This option has no effect for version '' + cfg.package.version + '', and enabling it is an error.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
environment.systemPackages = [ pkg ];
|
||||
|
||||
users.users = optionalAttrs (cfg.user == "foundationdb") (singleton
|
||||
|
|
Loading…
Reference in a new issue