-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Edit Setup.ts to reflect database needs #1772
Comments
I would like to work on this. |
@Cioppolo14 why do we need to have access to local database with a replica set. |
@adi790uu Its the developer's choice, either to run mongo atlas cluster or a local database converted to a replica set. If the local database doesn't have a replica set, retry writes won't work. Does that make sense? My wording may not have been great in the issue. |
It's going to have to be a mandatory requirement for non Atlas URLs for both the API database and API test database (which is created simultaneously) |
ok @Cioppolo14 do you want me to write a script which automatically makes the local instance to be a replica set, something like this : ` function executeCommand(command) { const ports = [27017, 27018]; executeCommand( console.log( |
And in case of atlas Url make sure retryWrites=true parameter is present in the url? like this: |
@palisadoes can you review the above comments and give me your opinion. |
We are awaiting feedback from @EshaanAgg on this topic |
Okay @palisadoes |
No need for a script. The user should be responsible for providing the correct URL. We should just inform the user of this difference through the setup script, and issue a warning if the user gives a local Mongo URL with retry writes enabled. The user should be able to bypass the warning if he choses to. |
@EshaanAgg atleast we can attach retryWrites=true parameter to the Atlas url if not present already. |
@palisadoes got it. |
After doing more research on this topic, @EshaanAgg is right. Keep in mind that not all persons installing the app will be technically knowledgeable. The script must make installation as foolproof as possible. |
@adi790uu @EshaanAgg @Cioppolo14
|
@palisadoes I encountered same while exploring talawa-admin. The potential reason for the recommendation to add For a temporary fix, adding |
@palisadoes I have made the thing work based on this article: https://dev.to/salim_angelo/how-to-convert-your-localhost-standalone-mongodb-cluster-into-a-replica-set-using-run-rs-npm-package-on-mac-os-54hd , I created a replication set and I am not facing the error for local instance of database. |
Though when we stop the run-rs session all the data will be lost so we need to keep it on during the development process which is not desirable. |
This was triggered when we created recurring events. @meetulr the previous behavior needs to be restored as part of your revised recurring event issue. I'm going to close this issue because we are working on a solution in the issue above. |
Do you mean we shouldn't use transactions? Replica set would be required for transactions. |
@meetulr What would you suggest as the solution to make setup.ts work correctly for local and hosted Mongo instances? Reopening |
@palisadoes I'm sorry I missed your comment. Actually though, I was thinking about it. What I mean is that we could add a check for it in I've tried it locally, it's working. This way we won't have problems with local single node standalone instances, and we can have transactions support in deployed versions. |
Can you implement this for this issue? |
@palisadoes sure I want to do this, I am already assigned two other issues I will unassign myself from one of them. |
merged latest changes from develop
merged latest changes from develop
merged latest changes from develop
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
Describe the bug
Currently, Talawa-api needs to have access to either a local database with a replica set or mongoDB atlas to use the retry writes option. Our setup.ts script does not support the user in ensure that one of these options is met.
Expected behavior
Setup.ts needs to guide the user to make sure the database will work with retry rewrites.
Actual behavior
Setup does not give the user this guidance.
Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship PalisadoesFoundation/talawa#359
The text was updated successfully, but these errors were encountered: