First step update the status in the below to CREATETABLE
-> Create nodes with hregioninfo in the constructor of create table handler.
Create those many nodes as in the splitkeys.
CREATED_SPLIT_KEYS (after the creation of all splitkey nodes)
if all are done 'ENABLED' will be the state of the table.
-> add regioninfo to META and on success delete the node created node one by one
-> IF master fail over happens
See in what step the node is
If failed in ASSIGN_USER_REGIONS
Just reassign all the regions
If failed in ADD_TO_META
Check what regions are not yet added to meta and then do the assignment for all the regions
We can ensure that the nodes that are available in the zk are the ones for which the meta entry is not updated
If failed in CREATING_TD
If tabledescriptor not found create it again. if not go to the next step
If failed in CREATED_SPLIT_KEYS
Delete the node so that atleast the next time creation is successful. Just log it as we cannot throw error back to the client.
We need to create one more api in client called 'isTableAvailable()' accepting splitKeys also. so that the user can use them to check if really
the table is created with all the splitkeys.
Currently the isTableAvailable() just checks if atleast one region is assigned to any RS.
The current changes does not guarentee that the user table will be created in a synchronous way to the client createTable api.
but will ensure that while creating any table if the master failover happens the table doesnot get created with less number of
regions but still the user thinks table creation is sucessful.
We now distinguish the states where a table was in create flow or in the enable flow.
Previously the ENABLING state was in master fail over scenario.
Pls provide your inputs.