Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
7.0.0, 7.1.1
-
Replicated using a 3 node cluster in Docker-Compose with Server 7.0.0 and 7.1.1
https://github.com/brantburnett/couchbase-index-manager/blob/master/.devcontainer/docker-compose.yml
-
Untriaged
-
1
-
Unknown
Description
When using ALTER INDEX with "action": "replica_count" to add an index replica, i.e.:
ALTER INDEX `def_inventory_hotel_url` ON `travel-sample`.`inventory`.`hotel` WITH {"action":"replica_count","num_replica":1}
|
Typically, the newly added replica is automatically built and becomes ready. However, I was recently testing an upgrade of couchbase-index-manager to use the 4.x release of the NodeJS SDK. This version of the SDK, by default, executes queries with a prepared query plan. So a query plan is generated, and then the query plan is executed, rather than executing the queries directly.
In this case, where a query plan is used, the replica is not being built automatically. It just remains in the "created" state in the UI. Additionally, attempting to use a BUILD INDEX command to build the index manually doesn't work because the primary replica is already built.
The workaround, in the case of the NodeJS SDK, is to ensure that
{adhoc: true}is passed with the ALTER INDEX query so it doesn't create a query plan and instead executes the query directly. However, this seems like something that may easily trip up others and a bug on the server side.