antietcd 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/anticluster.js CHANGED
@@ -191,6 +191,7 @@ class AntiCluster
191
191
  else
192
192
  {
193
193
  this.synced = false;
194
+ this.resync_state = null;
194
195
  this.antietcd.etctree.pause_leases();
195
196
  }
196
197
  }
@@ -250,7 +251,8 @@ class AntiCluster
250
251
 
251
252
  _continueResync()
252
253
  {
253
- if (Object.values(this.resync_state.dumps).filter(d => !d).length > 0)
254
+ if (!this.resync_state ||
255
+ Object.values(this.resync_state.dumps).filter(d => !d).length > 0)
254
256
  {
255
257
  // Some dump(s) are still pending
256
258
  return;
@@ -319,7 +321,8 @@ class AntiCluster
319
321
 
320
322
  _finishResync()
321
323
  {
322
- if (Object.values(this.resync_state.dumps).filter(d => !d).length > 0 ||
324
+ if (!this.resync_state ||
325
+ Object.values(this.resync_state.dumps).filter(d => !d).length > 0 ||
323
326
  Object.values(this.resync_state.loads).filter(d => !d.result).length > 0)
324
327
  {
325
328
  return;
package/antietcd.js CHANGED
@@ -17,7 +17,7 @@ const AntiPersistence = require('./antipersistence.js');
17
17
  const AntiCluster = require('./anticluster.js');
18
18
  const { runCallbacks, de64, b64, RequestError } = require('./common.js');
19
19
 
20
- const VERSION = '1.1.0';
20
+ const VERSION = '1.1.2';
21
21
 
22
22
  class AntiEtcd extends EventEmitter
23
23
  {
@@ -123,7 +123,7 @@ class AntiEtcd extends EventEmitter
123
123
  let done = 0;
124
124
  await new Promise((allOk, allNo) =>
125
125
  {
126
- res.map(promise => promise.then(r =>
126
+ res.map(promise => promise.then((/*r*/) =>
127
127
  {
128
128
  if ((++done) == res.length)
129
129
  allOk();
package/etctree.js CHANGED
@@ -535,7 +535,7 @@ class EtcTree
535
535
  if (req.start_revision && this.compact_revision && this.compact_revision > req.start_revision)
536
536
  {
537
537
  // Deletions up to this.compact_revision are forgotten
538
- return { compact_revision: this.compact_revision };
538
+ return { canceled: true, cancel_reason: 'Revisions up to '+this.compact_revision+' are compacted', compact_revision: this.compact_revision };
539
539
  }
540
540
  let watch_id = req.watch_id;
541
541
  if (watch_id instanceof Object)
@@ -566,7 +566,7 @@ class EtcTree
566
566
  cur.key_watchers = cur.key_watchers || [];
567
567
  cur.key_watchers.push(watch_id);
568
568
  }
569
- if (req.start_revision && req.start_revision < this.mod_revision)
569
+ if (req.start_revision && req.start_revision <= this.mod_revision)
570
570
  {
571
571
  // Send initial changes
572
572
  const imm = setImmediate(() =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antietcd",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Simplistic etcd replacement based on TinyRaft",
5
5
  "main": "antietcd.js",
6
6
  "scripts": {