Skip to content

fix: Fix replicaset check to not require ClusterMonitor role#19997

Merged
sharat87 merged 5 commits intoreleasefrom
fix/replicaset-check
Feb 7, 2023
Merged

fix: Fix replicaset check to not require ClusterMonitor role#19997
sharat87 merged 5 commits intoreleasefrom
fix/replicaset-check

Conversation

@sharat87
Copy link
Member

In the entrypoint.sh script, we check if the MongoDB in use, has replicaSet initiated or not. This is usually done with a rs.initiate() on the cluster.

We need the replicaSet to be enabled on MongoDB, since the backend server relies on MongoDB changeStreams, which is a feature, only available if replicaSet is enabled.

However, to use the changeStream APIs, having the read or readWrite role on MongoDB is enough. But the check we do in entrypoint.sh, runs rs.status() to see if replicaSet is initiated. This rs.status() call, unfortunately, requires the ClusterMonitor role, unlike the changeStream API.

To tackle this, we created the appsmithctl check_replica_set command. This command would attempt to use the changeStream API, and report success or failure. But this failed on certain configurations, where MongoDB was running as a single-node-cluster, on localhost, or a local/internal network. This was an edge case.

That edge case is solved by this PR. With this, we can use appsmithctl check-replica-set in the entrypoint.sh again.

@vercel
Copy link

vercel bot commented Jan 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
appsmith ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 6, 2023 at 1:11PM (UTC)

@what-the-diff
Copy link

what-the-diff bot commented Jan 24, 2023

@github-actions github-actions bot added the Bug Something isn't working label Jan 24, 2023
@sharat87 sharat87 requested review from mohanarpit and sum35h January 24, 2023 05:46
@sharat87 sharat87 linked an issue Jan 24, 2023 that may be closed by this pull request
1 task
@github-actions
Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Jan 31, 2023
@sharat87 sharat87 removed the Stale label Feb 2, 2023
@github-actions github-actions bot added Deployment DevOps Pod Issues related to devops Enhancement New feature or request labels Feb 2, 2023
@sharat87
Copy link
Member Author

sharat87 commented Feb 2, 2023

@sum35h or @mohanarpit, can I get a review on this please?

@sum35h
Copy link
Contributor

sum35h commented Feb 3, 2023

/build-deploy-preview

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/4084039241.
Workflow: On demand build Docker image and deploy preview.
PR: 19997.

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

Deploy-Preview-URL: https://ce-19997.dp.appsmith.com

@sum35h sum35h enabled auto-merge (squash) February 3, 2023 14:20
@sharat87
Copy link
Member Author

sharat87 commented Feb 6, 2023

/ok-to-test sha=02a6f71

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4100432209.
Workflow: Appsmith External Integration Test Workflow.
Commit: 02a6f71.
PR: 19997.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=19997&runId=4100432209_1

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

The following are new failures, please fix them before merging the PR

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/ActionExecution/Error_handling_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/AdminSettings/Admin_settings_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Binding/Bind_API_with_List_Widget_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Binding/Invalid_binding_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Binding/No_Binding_Prompt_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Binding/TableV2Widgets_NavigateTo_Validation_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/DynamicHeight/DynamicHeight_CanvasHeight_resize_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Linting/EntityPropertiesLint_spec.ts
cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/ForkApplication_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/ViewMode_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/VisualTests/JSEditorIndent_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/JSONForm/JSONForm_AutoGenerateFormEnabled_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Others/Autocomplete_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Tab/Tab_OnEvent_Navigation_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Tab_reset_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/TableV2/TableV2_Column_Order_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/TableV2/TableV2_Widget_Derived_Column_Computed_value_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Workspace/CreateAppWithSameNameInWorkspace_spec.js
cypress/integration/Regression_TestSuite/ServerSideTests/ApiTests/API_Unique_name_spec.js

@sharat87
Copy link
Member Author

sharat87 commented Feb 6, 2023

/ok-to-test sha=19e6c9c

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4103908470.
Workflow: Appsmith External Integration Test Workflow.
Commit: 19e6c9c.
PR: 19997.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=19997&runId=4103908470_1

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

The following are new failures, please fix them before merging the PR

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/Templates/Fork_Template_To_App_spec.js
cypress/integration/Regression_TestSuite/ServerSideTests/QueryPane/S3_2_spec.js

@sharat87 sharat87 disabled auto-merge February 7, 2023 00:08
@sharat87 sharat87 merged commit 87cffb6 into release Feb 7, 2023
@sharat87 sharat87 deleted the fix/replicaset-check branch February 7, 2023 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working DevOps Pod Issues related to devops Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Flag to skip ReplicaSet check

2 participants