• Julien Muchembled's avatar
    client: fix conflict of node id by never reading from storage without being connected to the master · 11d83ad9
    Julien Muchembled authored
    Client nodes ignored the state of the connection to the master node when reading
    data from storage, as long as their partition tables were recent enough. This
    way, they were able to finish read-only transactions even if they could't reach
    the master, which could be useful for high availability. The downside is that
    the master node ignored that their node ids were still used, which causes "uuid"
    conflicts when reallocating them.
    
    Rejected solutions:
    - An unused NEO Storage should not insist in staying connected to master node.
    - Reverting to big random node identifiers is a lot of work and it would make
      debugging annoying (see commit 23fad3af).
    - Always increasing node ids could have been a simple solution if we accepted
      that the cluster dies after that all 2^24 possible ids were allocated.
    
    Given that reading from storage without being connected to the master can only
    be useful to finish the current transaction (because we always ping the master
    at the beginning of every transaction), keeping such feature is not worth the
    effort.
    
    This commit fixes id conflicts in a very simple way, by clearing the partition
    table upon primary node failure, which forces reconnection to the master before
    querying any storage node. In such case, we raise a special exception that will
    cause the transaction to be restarted, so that the user does not get errors for
    temporary connection failures.
    11d83ad9
Name
Last commit
Last update
neo Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
BUGS.rst Loading commit data...
CHANGELOG.rst Loading commit data...
COPYING Loading commit data...
MANIFEST.in Loading commit data...
README.rst Loading commit data...
TESTS.txt Loading commit data...
TODO Loading commit data...
UPGRADE.rst Loading commit data...
ZODB.patch Loading commit data...
ZODB3.patch Loading commit data...
importer.conf Loading commit data...
neo.conf Loading commit data...
neoadmin Loading commit data...
neoctl Loading commit data...
neolog Loading commit data...
neomaster Loading commit data...
neomigrate Loading commit data...
neostorage Loading commit data...
setup.py Loading commit data...