We added a new node (to an initial cluster of 1 and migrations went fine. However the secondary indexes on the newly added node lag behind the first one. Is this expected? Shouldn’t we expect the secondary index statistics to match up on both nodes?
Does this mean that if node #1 goes down, node #2 will rebuild its secondary indexes?
It should automatically balance out. In some cases, dropping and re-creating the index is the best way to handle things like this (which will make it re-build). I’m not sure about your particular problem though…
There is a known issue on 3.14.0 that impacts secondary index:
Regression - [AER-5698] - (KVS) Records created via migrations are not added to secondary index. Fixed in version 3.14.0.2
If this is the issue you encountered, as a workaround, on version 3.14.0, you could restart the node that has less keys/entries and that should force the sindex to be rebuilt.
Secondary index are built on both master and prole transactions… so nodes would be able to take over server secondary index queries when a node leaves the cluster.
The bug caused records ‘created’ through an incoming migration to not have their secondary index created. So if you added an empty node, most records on that node would be created through incoming migrations and would be missing their secondary index.
Upgrade to version 3.14.0.2 and you should be fine, based on your description and the data you shared I am fairly certain this is the issue you did hit.