Secondary index scan Vs migration process



I have this general question: let us consider a scenario in which a node just came up and joined the cluster.

Now as to my understanding, there are 2 processes that take place.

  • Migrations from this node to the other nodes in the cluster
  • building up secondary indexes by scanning the disks on this node

So, I am curious to know what is the order of these two operations.

also, if they happen to be in parallel, if migrations are happening then building up the secondary indexes might be a bit out of sync

my later quest would be to understand: when the node is up and the migration process is initiated, which partitions are sent and received. On what basis does this partition level decision take place

lets discuss please