• Julien Muchembled's avatar
    Make the number of replicas modifiable when the cluster is running · c1b5233e
    Julien Muchembled authored
    neoctl gets a new command to change the number of replicas.
    
    The number of replicas becomes a new partition table attribute and
    like the PT id, it is stored in the config table. On the other side,
    the configuration value for the number of partitions is dropped,
    since it can be computed from the partition table, which is
    always stored in full.
    
    The -p/-r master options now only apply at database creation.
    
    Some implementation notes:
    
    - The protocol is slightly optimized in that the master now sends
      automatically the whole partition tables to the admin & client
      nodes upon connection, like for storage nodes.
      This makes the protocol more consistent, and the master is the
      only remaining node requesting partition tables, during recovery.
    
    - Some parts become tricky because app.pt can be None in more cases.
      For example, the extra condition in NodeManager.update
      (before app.pt.dropNode) was added for this is the reason.
      Or the 'loadPartitionTable' method (storage) that is not inlined
      because of unit tests.
      Overall, this commit simplifies more than it complicates.
    
    - In the master handlers, we stop hijacking the 'connectionCompleted'
      method for tasks to be performed (often send the full partition
      table) on handler switches.
    
    - The admin's 'bootstrapped' flag could have been removed earlier:
      race conditions can't happen since the AskNodeInformation packet
      was removed (commit d048a52d).
    c1b5233e
handler.py 4.88 KB