Update: Since I uncovered more problems here, I changed the title.
This fixes the following three issues:
PHOENIX-5550, local index is not correctly built when data existed in the data table.
2. Index ids are correctly generated on the client, so that index updates for different indexes are written into the same index.
3. Stale boundary cache is not correctly detected in some cases (namely when the scan already was in the second daughter region and that daugthter region is the last region.)
All of these happen when short view index ids are used (which is the default). The included test covers all three scenarios.
There should be two index rows.
And in fact there are with phoenix.index.longViewIndex.enabled set to true, there are correctly two different index entries for both of the local indexes.