From 6dee1ade099fbb44efc61ee0d5b65ce37273bb76 Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:56:28 +0530 Subject: [PATCH 01/31] PCSM-312 connection pool size configurable --- docs/install/parameters.md | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index bb4f3fb8..10bd9dcd 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -47,3 +47,43 @@ Alternatively, you can define the following environment variables: | `PCSM_REPL_WORKER_QUEUE_SIZE` | Defines the maximum number of replication events that each replication worker thread can queue before processing. | `5000` | | `PCSM_REPL_BULK_OPS_SIZE` | Defines the maximum number of operations that can be grouped together into a single bulk apply batch during replication. | `5000` | +## MongoDB connection string options + +PCSM supports the `maxPoolSize` MongoDB connection string option for configuring the maximum number of connections in the driver's connection pool. + +Specify the option in the source and target MongoDB connection strings passed through `--source` and `--target`, or the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables. + +### Syntax + +If the URI contains no query parameters: + +```bash +mongodb://host:27017/?maxPoolSize=500 +``` + +If the URI already includes query parameters, append `maxPoolSize` with `&`: + +```bash +mongodb://host:27017/?replicaSet=rs0&maxPoolSize=500 +``` + +### Default behavior + +If `maxPoolSize` is omitted, the MongoDB Go driver uses its default value of `100`. + +Setting `maxPoolSize=0` removes the limit and allows the driver to create an unlimited number of connections. + +### Recommendations + +For clone operations, configure the connection pool so that it is at least as large as the corresponding worker count: + +* **Source cluster:** `maxPoolSize >= clone-num-read-workers` +* **Target cluster:** `maxPoolSize >= clone-num-insert-workers` + +At startup, PCSM logs the effective `maxPoolSize` for both clients. If the configured pool size is lower than the corresponding clone worker count, PCSM logs a warning because the connection pool may become a bottleneck. + +!!! note + +``` +`maxPoolSize` applies to each MongoDB server or mongos that the client connects to. It is not a global connection limit for the entire client. +``` From 4b296a50696da01b7ba2757879b11eb8e7cadc15 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:08:48 +0530 Subject: [PATCH 02/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 10bd9dcd..be020720 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -83,7 +83,4 @@ For clone operations, configure the connection pool so that it is at least as la At startup, PCSM logs the effective `maxPoolSize` for both clients. If the configured pool size is lower than the corresponding clone worker count, PCSM logs a warning because the connection pool may become a bottleneck. !!! note - -``` -`maxPoolSize` applies to each MongoDB server or mongos that the client connects to. It is not a global connection limit for the entire client. -``` + `maxPoolSize` applies to each MongoDB server or mongos that the client connects to. It is not a global connection limit for the entire client. From 9121a581aa8f8e46790720148b160ae8a5edc7d3 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:08:59 +0530 Subject: [PATCH 03/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index be020720..ad2342de 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -77,8 +77,8 @@ Setting `maxPoolSize=0` removes the limit and allows the driver to create an unl For clone operations, configure the connection pool so that it is at least as large as the corresponding worker count: -* **Source cluster:** `maxPoolSize >= clone-num-read-workers` -* **Target cluster:** `maxPoolSize >= clone-num-insert-workers` +* **Source cluster:** `maxPoolSize` >= configured `--clone-num-read-workers` value +* **Target cluster:** `maxPoolSize` >= configured `--clone-num-insert-workers` value At startup, PCSM logs the effective `maxPoolSize` for both clients. If the configured pool size is lower than the corresponding clone worker count, PCSM logs a warning because the connection pool may become a bottleneck. From f7b32e54064470c58e74198fa38aa5767bc083a7 Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:15:40 +0530 Subject: [PATCH 04/31] Update parameters.md --- docs/install/parameters.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 10bd9dcd..91fc0e17 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -47,21 +47,22 @@ Alternatively, you can define the following environment variables: | `PCSM_REPL_WORKER_QUEUE_SIZE` | Defines the maximum number of replication events that each replication worker thread can queue before processing. | `5000` | | `PCSM_REPL_BULK_OPS_SIZE` | Defines the maximum number of operations that can be grouped together into a single bulk apply batch during replication. | `5000` | -## MongoDB connection string options -PCSM supports the `maxPoolSize` MongoDB connection string option for configuring the maximum number of connections in the driver's connection pool. +## MongoDB connection string option: `maxPoolSize` -Specify the option in the source and target MongoDB connection strings passed through `--source` and `--target`, or the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables. +PCSM supports the MongoDB `maxPoolSize` connection string option, which controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. + +Set this option in the source and target MongoDB connection strings that you pass with the `--source` and `--target` command-line options or through the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables. ### Syntax -If the URI contains no query parameters: +If the connection string does not include any query parameters: ```bash mongodb://host:27017/?maxPoolSize=500 ``` -If the URI already includes query parameters, append `maxPoolSize` with `&`: +If the connection string already contains query parameters, add `maxPoolSize` using `&`: ```bash mongodb://host:27017/?replicaSet=rs0&maxPoolSize=500 @@ -69,21 +70,22 @@ mongodb://host:27017/?replicaSet=rs0&maxPoolSize=500 ### Default behavior -If `maxPoolSize` is omitted, the MongoDB Go driver uses its default value of `100`. +If you do not specify `maxPoolSize`, the MongoDB Go driver uses the default value of `100`. -Setting `maxPoolSize=0` removes the limit and allows the driver to create an unlimited number of connections. +Setting `maxPoolSize=0` removes the limit, allowing the driver to create as many connections as needed. ### Recommendations -For clone operations, configure the connection pool so that it is at least as large as the corresponding worker count: +For the best clone performance, size the connection pool to match or exceed the number of clone workers. -* **Source cluster:** `maxPoolSize >= clone-num-read-workers` -* **Target cluster:** `maxPoolSize >= clone-num-insert-workers` +| Cluster | Recommended `maxPoolSize` | +| ------- | ----------------------------------- | +| Source | At least `clone-num-read-workers` | +| Target | At least `clone-num-insert-workers` | -At startup, PCSM logs the effective `maxPoolSize` for both clients. If the configured pool size is lower than the corresponding clone worker count, PCSM logs a warning because the connection pool may become a bottleneck. +When PCSM starts, it logs the effective `maxPoolSize` for both the source and target clients. If the configured pool size is smaller than the corresponding clone worker count, PCSM logs a warning because the available connections may limit throughput. !!! note + `maxPoolSize` applies independently to each MongoDB server or `mongos` instance that the client connects to. It does not define a single global connection limit for the entire client. + -``` -`maxPoolSize` applies to each MongoDB server or mongos that the client connects to. It is not a global connection limit for the entire client. -``` From 0212a70e3b35fb968d89f46d7aeeedfc753e3d9b Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:35:22 +0530 Subject: [PATCH 05/31] Update parameters.md --- docs/install/parameters.md | 44 +++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 91fc0e17..fa21e63d 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -50,6 +50,8 @@ Alternatively, you can define the following environment variables: ## MongoDB connection string option: `maxPoolSize` +!!! admonition "Version added: [0.10.0](../release-notes/0.10.0.md)" + PCSM supports the MongoDB `maxPoolSize` connection string option, which controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. Set this option in the source and target MongoDB connection strings that you pass with the `--source` and `--target` command-line options or through the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables. @@ -59,19 +61,51 @@ Set this option in the source and target MongoDB connection strings that you pas If the connection string does not include any query parameters: ```bash -mongodb://host:27017/?maxPoolSize=500 +mongodb://host:port/?maxPoolSize=500 ``` -If the connection string already contains query parameters, add `maxPoolSize` using `&`: +??? example "Example: maxPoolSize=500" + ``` + pcsm --source='mongodb://rs00:30000/?maxPoolSize=500' --target='mongodb://rs10:30100' --log-level='debug' + ``` -```bash -mongodb://host:27017/?replicaSet=rs0&maxPoolSize=500 -``` + Output + ``` + 2026-06-24 15:16:40.691 INF Percona ClusterSync for MongoDB v0.9.0 3eb82dd 2026-06-24_09:36_UTC + 2026-06-24 15:16:40.692 INF Config: source client compressors: [snappy zstd zlib] s=connect + 2026-06-24 15:16:40.692 INF Config: source client maxPoolSize: 500 s=connect + 2026-06-24 15:16:40.711 INF Connected to source cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs00:30000 + 2026-06-24 15:16:40.711 INF Config: target client compressors: [snappy zstd zlib] s=connect + 2026-06-24 15:16:40.711 INF Config: target client maxPoolSize: 100 (driver default) s=connect + 2026-06-24 15:16:40.724 INF Connected to target cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs10:30100 + 2026-06-24 15:16:40.728 INF Checking Recovery Data for "pcsm" s=recovery + 2026-06-24 15:16:40.729 INF Recovery Data not found s=recovery + 2026-06-24 15:16:40.729 INF Starting HTTP server at http://localhost:2242 + ``` ### Default behavior If you do not specify `maxPoolSize`, the MongoDB Go driver uses the default value of `100`. +??? example "Example: maxPoolSize not defined" + ``` + pcsm --source='mongodb://rs00:30000' --target='mongodb://rs10:30100' --log-level='debug' + ``` + + Output + ``` + 2026-06-24 15:15:04.503 INF Percona ClusterSync for MongoDB v0.9.0 3eb82dd 2026-06-24_09:36_UTC + 2026-06-24 15:15:04.504 INF Config: source client compressors: [snappy zstd zlib] s=connect + 2026-06-24 15:15:04.504 INF Config: source client maxPoolSize: 100 (driver default) s=connect + 2026-06-24 15:15:04.525 INF Connected to source cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs00:30000 + 2026-06-24 15:15:04.525 INF Config: target client compressors: [snappy zstd zlib] s=connect + 2026-06-24 15:15:04.525 INF Config: target client maxPoolSize: 100 (driver default) s=connect + 2026-06-24 15:15:04.533 INF Connected to target cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs10:30100 + 2026-06-24 15:15:04.546 INF Checking Recovery Data for "pcsm" s=recovery + 2026-06-24 15:15:04.546 INF Recovery Data not found s=recovery + 2026-06-24 15:15:04.546 INF Starting HTTP server at http://localhost:2242 + ``` + Setting `maxPoolSize=0` removes the limit, allowing the driver to create as many connections as needed. ### Recommendations From b15fe791d7463f5af77e45f6be0e6362f9c0d999 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:40:14 +0530 Subject: [PATCH 06/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index fa21e63d..2948f9cc 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -50,7 +50,7 @@ Alternatively, you can define the following environment variables: ## MongoDB connection string option: `maxPoolSize` -!!! admonition "Version added: [0.10.0](../release-notes/0.10.0.md)" +!!! admonition "Version added: 0.10.0" PCSM supports the MongoDB `maxPoolSize` connection string option, which controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. From 8b5e1bef0f2153612c150b9b167d6e2951daca38 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:40:24 +0530 Subject: [PATCH 07/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 2948f9cc..90d29510 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -65,12 +65,12 @@ mongodb://host:port/?maxPoolSize=500 ``` ??? example "Example: maxPoolSize=500" - ``` - pcsm --source='mongodb://rs00:30000/?maxPoolSize=500' --target='mongodb://rs10:30100' --log-level='debug' + ```{.bash data-prompt="$"} + $ pcsm --source='mongodb://rs00:30000/?maxPoolSize=500' --target='mongodb://rs10:30100' --log-level='debug' ``` Output - ``` + ```{.text .no-copy} 2026-06-24 15:16:40.691 INF Percona ClusterSync for MongoDB v0.9.0 3eb82dd 2026-06-24_09:36_UTC 2026-06-24 15:16:40.692 INF Config: source client compressors: [snappy zstd zlib] s=connect 2026-06-24 15:16:40.692 INF Config: source client maxPoolSize: 500 s=connect From 7ced4cc81aefec8862b4e09cdfc678aec5ad3c04 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:40:38 +0530 Subject: [PATCH 08/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 90d29510..15d5badd 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -60,9 +60,15 @@ Set this option in the source and target MongoDB connection strings that you pas If the connection string does not include any query parameters: -```bash +~~~bash mongodb://host:port/?maxPoolSize=500 -``` +~~~ + +If the connection string already includes query parameters, append `maxPoolSize` with `&`: + +~~~bash +mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 +~~~ ??? example "Example: maxPoolSize=500" ```{.bash data-prompt="$"} From 08541e14c4efa3723b4a2f28eeab52b41a1ab3d1 Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:43:09 +0530 Subject: [PATCH 09/31] Update parameters.md --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index fa21e63d..32bee986 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -48,7 +48,7 @@ Alternatively, you can define the following environment variables: | `PCSM_REPL_BULK_OPS_SIZE` | Defines the maximum number of operations that can be grouped together into a single bulk apply batch during replication. | `5000` | -## MongoDB connection string option: `maxPoolSize` +## MongoDB connection string !!! admonition "Version added: [0.10.0](../release-notes/0.10.0.md)" From c98cae06f243f8cb830301208618b938a557d50f Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:48:06 +0530 Subject: [PATCH 10/31] Update authentication.md --- docs/install/authentication.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/install/authentication.md b/docs/install/authentication.md index d1150ee5..609151a4 100644 --- a/docs/install/authentication.md +++ b/docs/install/authentication.md @@ -91,6 +91,7 @@ You can pass additional connection options to the MongoDB connection string. The | `tlsAllowInvalidCertificates` | Allows connections to servers with invalid certificates. Not recommended for production use. | | `tlsAllowInvalidHostnames` | Allows connections to servers with invalid hostnames. Not recommended for production use. | | `tlsInsecure` | Disables certificate validation. Not recommended for production use. | +| `maxPoolSize` | Controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. For detailed information about this option, see the section [MongoDB connection strings](parameters.md#mongodb-connection-string).| ## Next steps From 08b52e8bdd485cbc6f6f3b10904871f4ae9cfd38 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 08:21:40 +0000 Subject: [PATCH 11/31] Align maxPoolSize version marker with sample output --- docs/install/parameters.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index e8a865f8..dd1272bd 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -50,7 +50,7 @@ Alternatively, you can define the following environment variables: ## MongoDB connection string -!!! admonition "Version added: 0.10.0" +!!! admonition "Version added: 0.9.0" PCSM supports the MongoDB `maxPoolSize` connection string option, which controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. @@ -128,4 +128,3 @@ When PCSM starts, it logs the effective `maxPoolSize` for both the source and ta !!! note `maxPoolSize` applies independently to each MongoDB server or `mongos` instance that the client connects to. It does not define a single global connection limit for the entire client. - From 443ff3f11f0d861c59a4265f1169a80f9fd20f0a Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:09:39 +0530 Subject: [PATCH 12/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index dd1272bd..82062124 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -77,7 +77,7 @@ mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 Output ```{.text .no-copy} - 2026-06-24 15:16:40.691 INF Percona ClusterSync for MongoDB v0.9.0 3eb82dd 2026-06-24_09:36_UTC + 2026-06-24 15:16:40.691 INF Percona ClusterSync for MongoDB v0.10.0 3eb82dd 2026-06-24_09:36_UTC 2026-06-24 15:16:40.692 INF Config: source client compressors: [snappy zstd zlib] s=connect 2026-06-24 15:16:40.692 INF Config: source client maxPoolSize: 500 s=connect 2026-06-24 15:16:40.711 INF Connected to source cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs00:30000 From d3e1b95592c18d5cce5f9dd0222bbbe406ea96b1 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:09:49 +0530 Subject: [PATCH 13/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 82062124..df1204a7 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -120,8 +120,8 @@ For the best clone performance, size the connection pool to match or exceed the | Cluster | Recommended `maxPoolSize` | | ------- | ----------------------------------- | -| Source | At least `clone-num-read-workers` | -| Target | At least `clone-num-insert-workers` | +| Source | At least `--clone-num-read-workers` | +| Target | At least `--clone-num-insert-workers` | When PCSM starts, it logs the effective `maxPoolSize` for both the source and target clients. If the configured pool size is smaller than the corresponding clone worker count, PCSM logs a warning because the available connections may limit throughput. From 25e31165afc7c64dd6274498bd66a5a7cb348ddf Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:09:59 +0530 Subject: [PATCH 14/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/authentication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/authentication.md b/docs/install/authentication.md index 609151a4..b03df631 100644 --- a/docs/install/authentication.md +++ b/docs/install/authentication.md @@ -91,7 +91,7 @@ You can pass additional connection options to the MongoDB connection string. The | `tlsAllowInvalidCertificates` | Allows connections to servers with invalid certificates. Not recommended for production use. | | `tlsAllowInvalidHostnames` | Allows connections to servers with invalid hostnames. Not recommended for production use. | | `tlsInsecure` | Disables certificate validation. Not recommended for production use. | -| `maxPoolSize` | Controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. For detailed information about this option, see the section [MongoDB connection strings](parameters.md#mongodb-connection-string).| +| `maxPoolSize` | Controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. For detailed information about this option, see the section [MongoDB connection string](parameters.md#mongodb-connection-string). | ## Next steps From 8b34dc6a42d752e90543a52d63e881011a9c04bf Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:10:17 +0530 Subject: [PATCH 15/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index df1204a7..65e254f8 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -66,7 +66,7 @@ mongodb://host:port/?maxPoolSize=500 If the connection string already includes query parameters, append `maxPoolSize` with `&`: -~~~bash +~~~text mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 ~~~ From f1256e52d847f10d73d4751919a0c5c1432a93a7 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:10:32 +0530 Subject: [PATCH 16/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 65e254f8..b302ff59 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -60,7 +60,7 @@ Set this option in the source and target MongoDB connection strings that you pas If the connection string does not include any query parameters: -~~~bash +~~~text mongodb://host:port/?maxPoolSize=500 ~~~ From 21e4f65ef036109f2bcc4c8c93cf9173f053353f Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:10:51 +0530 Subject: [PATCH 17/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index b302ff59..56844993 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -94,13 +94,13 @@ mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 If you do not specify `maxPoolSize`, the MongoDB Go driver uses the default value of `100`. ??? example "Example: maxPoolSize not defined" - ``` - pcsm --source='mongodb://rs00:30000' --target='mongodb://rs10:30100' --log-level='debug' + ```{.bash data-prompt="$"} + $ pcsm --source='mongodb://rs00:30000' --target='mongodb://rs10:30100' --log-level='debug' ``` Output - ``` - 2026-06-24 15:15:04.503 INF Percona ClusterSync for MongoDB v0.9.0 3eb82dd 2026-06-24_09:36_UTC + ```{.text .no-copy} + 2026-06-24 15:15:04.503 INF Percona ClusterSync for MongoDB v0.10.0 3eb82dd 2026-06-24_09:36_UTC 2026-06-24 15:15:04.504 INF Config: source client compressors: [snappy zstd zlib] s=connect 2026-06-24 15:15:04.504 INF Config: source client maxPoolSize: 100 (driver default) s=connect 2026-06-24 15:15:04.525 INF Connected to source cluster [Percona Server for MongoDB 8.0.16-5]: mongodb://rs00:30000 From 767ed1fb07aad8bddc2918f537d186ad1b1873d5 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:12:53 +0530 Subject: [PATCH 18/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 56844993..a563fb08 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -50,7 +50,7 @@ Alternatively, you can define the following environment variables: ## MongoDB connection string -!!! admonition "Version added: 0.9.0" +!!! admonition "Version added: 0.10.0" PCSM supports the MongoDB `maxPoolSize` connection string option, which controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. From 98eb861b037326e1ed0752f5b2edbccf39e16359 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:15:23 +0530 Subject: [PATCH 19/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index a563fb08..373f6fd0 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -54,7 +54,7 @@ Alternatively, you can define the following environment variables: PCSM supports the MongoDB `maxPoolSize` connection string option, which controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. -Set this option in the source and target MongoDB connection strings that you pass with the `--source` and `--target` command-line options or through the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables. +Set this option in the source and/or target MongoDB connection strings that you pass with the `--source` and `--target` command-line options or through the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables. ### Syntax From 474cda1b8aa131186d4af035e95dbbd742676d96 Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:17:38 +0530 Subject: [PATCH 20/31] Update authentication.md --- docs/install/authentication.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/install/authentication.md b/docs/install/authentication.md index 609151a4..d1150ee5 100644 --- a/docs/install/authentication.md +++ b/docs/install/authentication.md @@ -91,7 +91,6 @@ You can pass additional connection options to the MongoDB connection string. The | `tlsAllowInvalidCertificates` | Allows connections to servers with invalid certificates. Not recommended for production use. | | `tlsAllowInvalidHostnames` | Allows connections to servers with invalid hostnames. Not recommended for production use. | | `tlsInsecure` | Disables certificate validation. Not recommended for production use. | -| `maxPoolSize` | Controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. For detailed information about this option, see the section [MongoDB connection strings](parameters.md#mongodb-connection-string).| ## Next steps From cb8cdf48fd7d014bfe3da31903d56b7f143c3275 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:21:17 +0530 Subject: [PATCH 21/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 373f6fd0..bd7ea94c 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -64,7 +64,7 @@ If the connection string does not include any query parameters: mongodb://host:port/?maxPoolSize=500 ~~~ -If the connection string already includes query parameters, append `maxPoolSize` with `&`: +If the connection string already includes other query parameters, append `maxPoolSize` with `&`: ~~~text mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 From db467b46687167ec0cac54b27cedef7416a7ecea Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:21:30 +0530 Subject: [PATCH 22/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index bd7ea94c..891c5be7 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -58,7 +58,7 @@ Set this option in the source and/or target MongoDB connection strings that you ### Syntax -If the connection string does not include any query parameters: +If the connection string does not already include any query parameters: ~~~text mongodb://host:port/?maxPoolSize=500 From 6b714570687e562ca3f70bf5d39742ac4f1d83e4 Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:37:55 +0530 Subject: [PATCH 23/31] Update parameters.md --- docs/install/parameters.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 373f6fd0..4dec32f9 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -58,13 +58,15 @@ Set this option in the source and/or target MongoDB connection strings that you ### Syntax -If the connection string does not include any query parameters: +Append `maxPoolSize` as a query parameter to your connection string: + +Without existing query parameters: ~~~text mongodb://host:port/?maxPoolSize=500 ~~~ -If the connection string already includes query parameters, append `maxPoolSize` with `&`: +With existing query parameters: ~~~text mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 @@ -89,9 +91,14 @@ mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 2026-06-24 15:16:40.729 INF Starting HTTP server at http://localhost:2242 ``` -### Default behavior +### How maxPoolSize works + +| **Configuration**|**Behavior**| +|-------------|--------| +| `maxPoolSize` not set | Driver defaults to **100** connections | +| `maxPoolSize=N`| Driver caps the pool at **N** connections | +| `maxPoolSize=0`| Removes the limit, allowing the driver to create as many connections as needed.| -If you do not specify `maxPoolSize`, the MongoDB Go driver uses the default value of `100`. ??? example "Example: maxPoolSize not defined" ```{.bash data-prompt="$"} @@ -111,9 +118,7 @@ If you do not specify `maxPoolSize`, the MongoDB Go driver uses the default valu 2026-06-24 15:15:04.546 INF Recovery Data not found s=recovery 2026-06-24 15:15:04.546 INF Starting HTTP server at http://localhost:2242 ``` - -Setting `maxPoolSize=0` removes the limit, allowing the driver to create as many connections as needed. - + ### Recommendations For the best clone performance, size the connection pool to match or exceed the number of clone workers. From 12b4ec3b6824f55af7b287e72332661503e6822f Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:46:40 +0530 Subject: [PATCH 24/31] Update parameters.md --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 4dec32f9..35998c6e 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -95,7 +95,7 @@ mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 | **Configuration**|**Behavior**| |-------------|--------| -| `maxPoolSize` not set | Driver defaults to **100** connections | +| Not set | Driver defaults to **100** connections | | `maxPoolSize=N`| Driver caps the pool at **N** connections | | `maxPoolSize=0`| Removes the limit, allowing the driver to create as many connections as needed.| From 8706aea198483977059d2ad024e377052887bab6 Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:47:04 +0530 Subject: [PATCH 25/31] Update parameters.md --- docs/install/parameters.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 35998c6e..9613adf2 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -131,5 +131,4 @@ For the best clone performance, size the connection pool to match or exceed the When PCSM starts, it logs the effective `maxPoolSize` for both the source and target clients. If the configured pool size is smaller than the corresponding clone worker count, PCSM logs a warning because the available connections may limit throughput. !!! note - `maxPoolSize` applies independently to each MongoDB server or `mongos` instance that the client connects to. It does not define a single global connection limit for the entire client. - + `maxPoolSize` applies independently to each MongoDB server or `mongos` instance that the client connects to. It does not define a single global connection limit for the entire client. \ No newline at end of file From e510a5168360d3492bcf756024603382ef2d9754 Mon Sep 17 00:00:00 2001 From: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:51:31 +0530 Subject: [PATCH 26/31] Update parameters.md --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 9613adf2..8096f673 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -54,7 +54,7 @@ Alternatively, you can define the following environment variables: PCSM supports the MongoDB `maxPoolSize` connection string option, which controls the maximum number of connections the MongoDB Go driver can maintain in its connection pool. -Set this option in the source and/or target MongoDB connection strings that you pass with the `--source` and `--target` command-line options or through the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables. +You can set this option in the source and/or target MongoDB connection strings using `--source` and `--target` command-line options or through the `PCSM_SOURCE_URI` and `PCSM_TARGET_URI` environment variables. ### Syntax From f4929eb43e9c9faebca9eb07c8e678ac006a3ae4 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 16:18:04 +0530 Subject: [PATCH 27/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 8096f673..ce3ff59b 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -73,6 +73,7 @@ mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 ~~~ ??? example "Example: maxPoolSize=500" + ```{.bash data-prompt="$"} $ pcsm --source='mongodb://rs00:30000/?maxPoolSize=500' --target='mongodb://rs10:30100' --log-level='debug' ``` From cfad366aae3c9f75ef52c778ba7cefc6b9476862 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 16:18:21 +0530 Subject: [PATCH 28/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index ce3ff59b..7701e67d 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -94,11 +94,11 @@ mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 ### How maxPoolSize works -| **Configuration**|**Behavior**| -|-------------|--------| +| **Configuration** | **Behavior** | +| --------------- | -------- | | Not set | Driver defaults to **100** connections | -| `maxPoolSize=N`| Driver caps the pool at **N** connections | -| `maxPoolSize=0`| Removes the limit, allowing the driver to create as many connections as needed.| +| `maxPoolSize=N` | Driver caps the pool at **N** connections | +| `maxPoolSize=0` | Removes the limit, allowing the driver to create as many connections as needed. | ??? example "Example: maxPoolSize not defined" From 68bb56e224812eb6a3f696e6e006fd4ddc990a39 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 26 Jun 2026 16:18:31 +0530 Subject: [PATCH 29/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 7701e67d..cbdfe31a 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -102,6 +102,7 @@ mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 ??? example "Example: maxPoolSize not defined" + ```{.bash data-prompt="$"} $ pcsm --source='mongodb://rs00:30000' --target='mongodb://rs10:30100' --log-level='debug' ``` From c52a49f4569b35e18f8460aa38305a6ebec4a0dc Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Mon, 29 Jun 2026 13:21:32 +0530 Subject: [PATCH 30/31] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index cbdfe31a..345ad867 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -120,7 +120,7 @@ mongodb://host:port/?replicaSet=rs0&maxPoolSize=500 2026-06-24 15:15:04.546 INF Recovery Data not found s=recovery 2026-06-24 15:15:04.546 INF Starting HTTP server at http://localhost:2242 ``` - + ### Recommendations For the best clone performance, size the connection pool to match or exceed the number of clone workers. From 56a4fb94ff58d8fa26f46a638eaa2dbdc83d0cb1 Mon Sep 17 00:00:00 2001 From: Rasika Chivate <95711051+rasika-chivate@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:05:31 +0530 Subject: [PATCH 31/31] Update docs/install/parameters.md Co-authored-by: Adnan --- docs/install/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/parameters.md b/docs/install/parameters.md index 345ad867..44d1f1c2 100644 --- a/docs/install/parameters.md +++ b/docs/install/parameters.md @@ -130,7 +130,7 @@ For the best clone performance, size the connection pool to match or exceed the | Source | At least `--clone-num-read-workers` | | Target | At least `--clone-num-insert-workers` | -When PCSM starts, it logs the effective `maxPoolSize` for both the source and target clients. If the configured pool size is smaller than the corresponding clone worker count, PCSM logs a warning because the available connections may limit throughput. +When PCSM starts, it logs the effective `maxPoolSize` for both the source and target clients. !!! note `maxPoolSize` applies independently to each MongoDB server or `mongos` instance that the client connects to. It does not define a single global connection limit for the entire client. \ No newline at end of file