I have a cluster with two nodes. I want to create an index on one of the nodes using:
CREATE INDEX `geo_nearest_location` ON `data`((ALL (ARRAY [(`p`.`lat`), (`p`.`lon`)] FOR `p` IN `points` END)),`type`,`name`,`key`)
WHERE (`type` IN ['Lake', 'Stream', 'PutTakeLake', 'CoastLocalArea', 'SeaLocalArea']) WITH {'defer_build':TRUE,'nodes':['db1.aqua.dtu.dk:8091']}
and it returns:
[
{
"code": 5000,
"msg": "GSI CreateIndex() - cause: Encountered transient error. Index creation will be retried in background. Error: Indexer Cannot Process Create Index - Rebalance In Progress\n",
"query": "CREATE INDEX `geo_nearest_location` ON `data`((ALL (ARRAY [(`p`.`lat`), (`p`.`lon`)] FOR `p` IN `points` END)),`type`,`name`,`key`)\nWHERE (`type` IN ['Lake', 'Stream', 'PutTakeLake', 'CoastLocalArea', 'SeaLocalArea']) WITH {'defer_build':TRUE,'nodes':['db1.aqua.dtu.dk:8091']}"
}
]
However, as far as I can see, no rebalance is in progress…???
If I try the index creation once again I get:
[
{
"code": 5000,
"msg": "GSI CreateIndex() - cause: Index already exist. Fail to create geo_nearest_location_1 in bucket data",
"query": "CREATE INDEX `geo_nearest_location_1` ON `data`((ALL (ARRAY [(`p`.`lat`), (`p`.`lon`)] FOR `p` IN `points` END)),`type`,`name`,`key`)\nWHERE (`type` IN ['Lake', 'Stream', 'PutTakeLake', 'CoastLocalArea', 'SeaLocalArea']) WITH {'nodes':['db1.aqua.dtu.dk:8091']}"
}
]
But if I try to query the index:
SELECT * FROM system:indexes WHERE name='geo_nearest_location'
it just returns
{
"results": []
}
The index works fine in our test environment (same version servers and similar cluster setup).
Edit:
Forgot to mention that I have tried to manually build the index:
BUILD INDEX ON `data` (`geo_nearest_location`)
and it just returns:
[
{
"code": 5000,
"msg": "GSI index geo_nearest_location not found.",
"query": "BUILD INDEX ON `data` (`geo_nearest_location`)"
}
]
What could be wrong here? How do I get the index created?
Thanks!
/John
I’m on Community Edition 6.6.0 build 7909 on CentOS 7.9