PromucFlow_constructor/deploy/docker/utils/bin
Shrikant Sharat Kandula 87cffb6a05
fix: Fix replicaset check to not require ClusterMonitor role (#19997)
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 `changeStream`s, 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.
2023-02-07 05:38:37 +05:30
..
backup.js feat: appsmithctl version and mongo-eval utils (#19075) 2023-01-03 12:14:21 +05:30
backup.test.js feat: appsmithctl version and mongo-eval utils (#19075) 2023-01-03 12:14:21 +05:30
check_replica_set.js fix: Fix replicaset check to not require ClusterMonitor role (#19997) 2023-02-07 05:38:37 +05:30
constants.js feat: appsmith ctl jest with workflow (#17713) 2022-11-01 12:57:41 +05:30
estimate_billing.js Fixing bug where the Mongo DB URL wasn't being picked up by the billing script (#15378) 2022-07-22 18:11:02 +05:30
export_db.js Backup & Restore commands for appsmithctl (#14270) 2022-06-09 09:14:18 +05:30
import_db.js Add appsmithctl command to migrate instance to new server (#9508) 2021-12-17 10:39:20 +05:30
index.js feat: appsmithctl version and mongo-eval utils (#19075) 2023-01-03 12:14:21 +05:30
logger.js feat: appsmith ctl jest with workflow (#17713) 2022-11-01 12:57:41 +05:30
mailer.js appsmithctl backup error logging and mailer (#14797) 2022-07-07 11:19:25 +05:30
migrate.js Add appsmithctl command to migrate instance to new server (#9508) 2021-12-17 10:39:20 +05:30
mongo_shell_utils.js feat: appsmithctl version and mongo-eval utils (#19075) 2023-01-03 12:14:21 +05:30
restore.js appsmithctl backup error logging and mailer (#14797) 2022-07-07 11:19:25 +05:30
utils.js fix: Fix replicaset check to not require ClusterMonitor role (#19997) 2023-02-07 05:38:37 +05:30
version.js feat: appsmithctl version and mongo-eval utils (#19075) 2023-01-03 12:14:21 +05:30