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

Momo generates a lot of Mongo Errors #624

Closed
YaniKolev opened this issue Aug 7, 2023 · 3 comments · Fixed by #627
Closed

Momo generates a lot of Mongo Errors #624

YaniKolev opened this issue Aug 7, 2023 · 3 comments · Fixed by #627

Comments

@YaniKolev
Copy link
Contributor

Looks like we expect and gracefully handle a Mongo error here: https://github.com/TNG/momo-scheduler/blob/main/src/repository/SchedulesRepository.ts#L57

However, this spams the logs of any responsible DB with errors like MongoServerError: E11000 duplicate key error collection:(...).

There are expected at this place and we do handle them correctly but the behaviour can make people think there's something wrong with the service.

We should investigate if there's a different way to perform this check

@YaniKolev
Copy link
Contributor Author

YaniKolev commented Aug 8, 2023

If we decide to solve the issue via transactions, we should make it clear what Mongo version we require. I think they might be a v5 version. We should also make sure to clearly communicate what the required actual DB version is.

@weissu42
Copy link
Member

weissu42 commented Aug 18, 2023

Looks like transactions are available since Mongo 4.2: https://www.mongodb.com/docs/v5.0/core/transactions/
(but one must use a replica set)

@weissu42
Copy link
Member

weissu42 commented Aug 18, 2023

MongoSchedule#isActiveSchedule() seems to be unused and should be removed
(SchedulePing uses SchedulesRepository directly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants