Compare commits

..

7 Commits

3 changed files with 3 additions and 2 deletions

View File

@ -228,6 +228,7 @@ class AntiCluster
throw new Error('BUG: no max term during resync');
}
with_max = with_max.filter(w => w != this.cfg.node_id);
console.log('Local term '+this.antietcd.stored_term+', max follower term '+max_term+' at nodes '+with_max.join(', '));
// Merge databases of all nodes with maximum term
// Force other nodes to replicate the merged DB, throwing away their own states
for (let i = 0; i < with_max.length; i++)

View File

@ -28,7 +28,7 @@ class AntiPersistence
this.loading = true;
this.antietcd.etctree.load(data);
this.loading = false;
this.antietcd.stored_term = data['term'];
this.antietcd.stored_term = data['term'] || 0;
}
else if (err.code != 'ENOENT')
{

View File

@ -292,7 +292,7 @@ class EtcTree
{
for (const k in cur_old.children)
{
if (!cur_new.children[k])
if (!cur_new.children || !cur_new.children[k])
{
// Delete subtree
this._delete_all(