-
Notifications
You must be signed in to change notification settings - Fork 8
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
Upgraded Mongo to 7.0 from 5.0 #470
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic to have MongoDB 7.0 and mitigating the soon EOL issue.
Overall looks good @Alopalao, and we can rely on this PR here to link as a doc for the upgrade, but there are still points to be refined/documented:
-
Add a
General Information
section in the changelog stating that MongoDB 7.0 is the recommended, tested, and supported version. Other version of course can still work, but just to highlight that will the one being actively maintained and tested, and then also add a link to this PR url, for more information about how to upgrade. -
When follow the steps to upgrade I hit an issue where it didn't recover from, containers kept restarting, I had to use
db.adminCommand( { setFeatureCompatibilityVersion: "6.0" } )
before upgrading the images to 7.0, double check if steps 7 and 8 need to be reordered. Also, there are steps saying to stopkytosd
again, no need to startkytosd
during 6.0 since this is just a transitive version for the upgrade. -
Let's also run a stress test, if you haven't run any with
vegeta
yet, let's target one endpoint that hits the DB, no expected surprises, especially since MongoDB 7.0 is a LTS/stable version (I see that the APM agent is working correctly) -
Document on this PR how to backup the docker volumes first, and exporting mongodb data, and let's go over that procedure at least once, let's simulate a worst case in prod, where this guide is followed but then on 7.0 containers don't start correctly. How can network operators revert to 5.0 with the original docker volumes (at AmLight we know containers are being used so it's ok to only cover containers volumes). This is very critical to prod, let's not only hope for the best.
-
Excellent to see e2e passing. On GitLab https://gitlab.ampath.net/kytos/kytos-end-to-end-tester/-/blob/master/.gitlab-ci.yml needs to be updated too, check out the
services
there on 5.0. We also need to decide on a strategy, if we'll upgrade there to 7.0, and then upgradeamlight/kytos-end-to-end-tester
on 7.0 to be able to run e2e on demand, but then we can maybe also create a new repo copy ofamlight/kytos-end-to-end-tester
to still have it on 5.0 just so if any patch on2024.1
still needs to be patched then we can also test on 5.0 in the CI? and then we maintain the 5.0 there until prod upgrades to 7.0 when they deploy the future version2024.2
probably by the end of the year? Let me know if you have any other suggestions. In practice, no expected issues to also test future patches of2024.1
with 7.0, but for completeness let's be ready for that case too. This also needs to include @italovalcy in the conversation.
Hi team, Great work, Aldo! very nice done!
Another approach would be having both tests on the end-to-end daily execution (5.0 and 7.0), just to make sure no surprises will be detected. |
Good idea having two parallel pipelines on end-to-end project nightly on 7.0 and on 5.0. Let's also consider this, if the available GitLab workers can pick up the work in parallel, and then we maintain it until prod gets upgraded to 7.0. |
Test description:
Overall ResultsTiming measure for bulk_write Database created and tests performed in mongo 5.0:OverviewTraceRequest POST
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see that overall the DB ops latencies are similar as we'd expect, that's a good start. On flow_manager delete if you could also include in the screenshot how long the DB operation was taking (on 5.0 you included that correctly, but that was truncated on 7.0 screenshot):
I'm just waiting now the the rest of the points on this comment to be addressed to approve it
@Alopalao if you could also post the output of |
Vegeta report results from Mongo 7.0
Mongo 5.0
The error from both tests come from concurrency limit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done @Alopalao, great to have Mongo 7.0 and well documented regarding the upgrade and related procedures here on this PR. I'll leave this pre-approved. It'll get merged when the rest of GitLab CI gets sorted out.
Closes #451
Summary
Updated MongoDB to 7.0.
Local Tests
Updated MongoDB and run some tests. No noticeable changes between the versions and data generation.
Update steps
Before following the update procedure, be sure to download the latest Mongo package. To check on active database mongosh can be installed (For Debian 12 follow Ubuntu 22.04 process).
To update follow this instructions:
db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )
. This change can be checked withdb.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
mongo-rs-init
,mongo1
,mongo2
andmongo3
. To check their status enter the console commanddocker ps -a
. Example:Stop each container with
docker stop $CONTAINER_ID
. E.g.docker stop 493d530e4104
.kytos/docker-compose.yml
mongo images to 6.0 (There are 4).docker compose up -d
.db.adminCommand( { setFeatureCompatibilityVersion: "6.0" } )
kytos/docker-compose.yml
mongo images to 7.0docker compose up -d
. The result can be verified with mongosh with the commandmongosh mongo1:27017,mongo2:27018,mongo3:27019
.Discrepancies
Kytos does not pass
"hello"
command on MongoDBThere maybe some problems with the version compatibility. To check this you can check the mongo1 container. Run
docker logs $CONTAINER_ID | grep "Invalid feature compatibility version"
to check settings. In the results check for:The compatibility version is set to 5.0 which means that the version
kytos/docker-compose.yml
needs to change to either 5.0 or 6.0 (in the case of 6.0, the containers are compatible with 6.0 and 7.0).Change
docker-compose.yml
accordingly, stop and delete containers. Finally run kytos or executedocker compose up -d
and continue with the update processAPM not working
Stop and delete the containers created from
docker-compose.es.yml
. And create them again.Problems with creating containers after
docker compose up -d
The problems could be errors while recreating container or a container ID already in use. Stop and delete the containers created from
docker-compose.yml
.Port 27017 or 8181 is already in use
sudo fuser -k 27017/tcp
worked (or8181/tcp
depending on the error).Downgrade
Downgrading can be done depending on the compatibility version on the database.:
Before executing each time the containers with different version, stop the containers
mongo1, mongo2 and mongo3
with the previous version.Save and restore database
Command to export:
It will create a folder with the database name, by default kytos database name is
napps
Command to restore:
End-to-End Tests
The e2e tests depend on this PR