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

mongodb-3_4, mongodb-3_6: drop #207382

Merged
merged 2 commits into from
Dec 31, 2022
Merged

mongodb-3_4, mongodb-3_6: drop #207382

merged 2 commits into from
Dec 31, 2022

Conversation

wegank
Copy link
Member

@wegank wegank commented Dec 23, 2022

Description of changes

#203814 seems to be stalled, so let's try again.

The original PR drops boost160 while keeping boost159. I think it would be better to drop them both after #207373.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.05 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Dec 23, 2022
@ofborg ofborg bot added 8.has: clean-up 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Dec 23, 2022
@wegank wegank requested a review from dotlambda December 27, 2022 08:47
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 10.rebuild-linux: 1 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Dec 27, 2022
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/1620

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/762

@SuperSandro2000 SuperSandro2000 merged commit 407160f into NixOS:master Dec 31, 2022
@wegank wegank deleted the mongodb branch January 1, 2023 08:18
@gador
Copy link
Member

gador commented Jan 4, 2023

Just for anyone dropping by:

This harsh update from version 3.4 to 6.0 breaks unifi which uses pkgs.mongodb by default.
For the next time, can we please update more gradually? I know, mongodb 3.4 is EOL for quite some time now, but other services and packages depend on it and should have more gradually move to the new version to allow the updates to not break the database.

For others who noticed the database getting corrupted:

nix-shell -p mongodb-3_4 mongodb-tools
mongod --dbpath /var/lib/unifi/data/db  --logpath /var/log/unifi/repair.log --repair
mongod --dbpath /var/lib/unifi/data/db  --logpath /var/log/unifi/repair.log --journal --fork
mongodump --out=/root/mongodump
pkill mongod
exit
nix-shell -p mongodb-4_2 mongodb-tools
# remove old data dir and recreate it
mv /var/lib/unifi/data/db /var/lib/unifi/data/db_bak
mkdir /var/lib/unifi/data/db
mongod --dbpath /var/lib/unifi/data/db  --logpath /var/log/unifi/repair.log --journal --fork
mongorestore /root/mongodump
pkill mongod
nix-shell -p mongodb-5_0 mongodb-tools
(rinse and repeat)
nix-shell -p mongodb-6_0 mongodb-tools
(rinse and repeat)

I'm not sure whether thes gradual procedure is necessary, but at least it works.

EDIT:
It seems to be an isolated problem with unifi which defaults to pkgs.mongodb. This should obviously be fixed in the unifi service to be a fixed version

gador added a commit to gador/nixpkgs that referenced this pull request Jan 5, 2023
Otherwise unifi might break on a next big update
just like NixOS#207382 (comment)

Also this requires an update of the unifi package. With the LTS
version, newer mongodb versions aren't supported. The current supported
version of unifi 7 is mongodb 3.6 acording to
https://community.ui.com/releases/UniFi-Network-Application-7-0-20/3e4a4099-c063-42f6-8e21-5fb2c99fcea9 which isn't even supplied by nixpkgs anymore.

mongodb-4_2 isn't officially supported, but works.

Signed-off-by: Florian Brandes <[email protected]>
@Artturin
Copy link
Member

Artturin commented Jan 9, 2023

This needs a release note and upgrade instructions if needed

@gador
Copy link
Member

gador commented Jan 10, 2023

What would be the best way to tackle this?
I just tested this in a VM with an older commit (677ed08) with the older mongodb and a more recent commit with the newer mongodb-4_2.
Unfortunately even the update from 3_4 to 4_2 breaks the database. Should we add a check for stateVersion and a warning to first backup the database?

I just feel a release note isn't enough, since every user who updates to 23.05 will break their unifi installation.

@wegank
Copy link
Member Author

wegank commented Jan 10, 2023

Perhaps by specifying in the release note that MongoDB upgrades must be done (and progressively, following the official instruction 3.4 -> 3.6 -> 4.0 -> 4.2 (-> 4.4)) in 22.11 before upgrading to 23.05?

@gador
Copy link
Member

gador commented Feb 23, 2023

@wegank and @mweinelt
I prepared a gist: https://gist.github.com/gador/a740144a6949b1272991cda5e35b8457 for an update of the mongo database.
This is tested on 22.11 with migration to the newer mongodb version before update as well as on current master with migration after the update. Maybe you could have a look.

Should we link it in the release notes? Include it in NixOS? I'm not sure what the best approach would be.

I also though about an automatic migration in the NixOS service, but I'm afraid this wouldn't be robust.

@RaitoBezarius
Copy link
Member

@wegank and @mweinelt I prepared a gist: https://gist.github.com/gador/a740144a6949b1272991cda5e35b8457 for an update of the mongo database. This is tested on 22.11 with migration to the newer mongodb version before update as well as on current master with migration after the update. Maybe you could have a look.

Should we link it in the release notes? Include it in NixOS? I'm not sure what the best approach would be.

I also though about an automatic migration in the NixOS service, but I'm afraid this wouldn't be robust.

Awesome, thank you. I do not advise for automatic migrations as you remarked it would not be robust.

@riotbib, the release editor for 23.05 can help you find a way to format those instructions properly in the release notes.

@wegank
Copy link
Member Author

wegank commented May 19, 2023

@riotbib @winterqt Could you please take a look at including the instructions in the release notes?

@riotbib
Copy link
Member

riotbib commented May 19, 2023

@riotbib @winterqt Could you please take a look at including the instructions in the release notes?

Sure, @wegank. Added to my TODOs. Thanks for the reminder!

@Ralith
Copy link
Contributor

Ralith commented Jul 8, 2023

This bit me today, after reading the release notes and seeing no mention of breaking changes :(

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: clean-up 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants