Description
On a multi-node cluster, two cbq shell sessions connected to distinct nodes have a window where index metadata is not fully synchronized.
To repro the problem:
Set up a 4.1.0 cluster with at least 2 nodes running the Query service. Start a cbq session on two different Query nodes. In cbq on one of the query nodes perform a CREATE INDEX command, then on the other attempt a command that references that index (e.g. a BUILD INDEX or a DROP INDEX). This will fail with "GSI index <INDEX_NAME> not found." (Code 5000). On the same node, run SELECT * FROM system:indexes - this refreshes the list of indexes, and the BUILD or DROP command will then run successfully.