Closed dang-stripe closed 1 month ago
A more desired solution would be:
Pros:
We can also consider combining the 2 approaches: when ZNode version doesn't match, we perform the check. When server detect that there is no need to reload the index, it updates the ZNode version within the segment without reloading it.
We're interested in having an API to know whether or not segments need to be reloaded for a table. The use case is to build robust automation around segment reloads after table/schema changes without having to depend directly on the table/schema change triggering the reload.
Currently, reload segments fans out ZK messages to all servers hosting segments for the table and the servers process them 1 at a time w/ the default config. While there's an API to check the column/index information for a segment, it's expensive to do a scatter-gather for all segments and compare that data against the current table/schema config.
One idea is to have servers track the znode version of both the table and schema configs that a segment was last reloaded with in memory and expose an API to the controller to fetch this version and compare it with the latest znode version to return to the caller whether there are segments that need to be reloaded.
cc @Jackie-Jiang @jadami10