amino-os / Amino.Run

Amino Distributed OS - Runtime Manager
Apache License 2.0
29 stars 12 forks source link

Consensus DM: Add unit tests for node reboots (correctly persist state) #82

Open ghost opened 6 years ago

ghost commented 6 years ago

The consensus DM implemented in #56 lacks the ability to persist it's persistent state (including the log). So if a node reboots, this supposedly persistent state will be lost.

So the task is to:

  1. Create a PersistentArrayList class, and make the log an instance of that, instead of the current ArrayList.
  2. Persist other persistent state (currentTerm, votedFor, log).
  3. Restore this persistent state on startup.
  4. Given that unit tests run on a single node, it will be necessary to be able to persist multiple persistent states on a single node. I suggest creating a subdirectory for each UUID to separate them. And on startup, restore from the newest subdirectory, with the ability to override this for unit and system tests (so that multiple servers can be restored on the same node.
ghost commented 6 years ago

Any volunteers?

ghost commented 6 years ago

Depends on #79 . Please implement that first.

ghost commented 6 years ago

Has anyone started working on this yet. If you have, please add a note here. Otherwise I will start to implement it soon. I will maka e a note here when I do.

quinton-hoole commented 6 years ago

Assigning to @Preethikathamuthu and myself. Not RC1.

Vishwa4jeet commented 5 years ago

@quinton-hoole-2 Needed a few clarifications on this issue:

  1. When we talk about persisting data, where do we plan to persist it ?
  2. And does restoring means just repopulating the logs on the node which went down ?
quinton-hoole commented 5 years ago

@Vishwa4jeet Restore pState from local disk. Did you read the RAFT paper linked in the code?

Vishwa4jeet commented 5 years ago

Yes, I had gone through it once but it's been a while now. Perhaps I will read through it once more during this weekend. Thank you. 🙂

quinton-hoole commented 5 years ago

Status update: Any progress @Vishwa4jeet and @Preethikathamuthu ?

prostil commented 5 years ago

We need to first finish the issues with consensus then work on this

quinton-hoole commented 5 years ago

Reassigned to @jithhuawei who has started work on this:

Design doc:

https://docs.google.com/document/d/19NJ3bwbgHO3cTWj2dFYoA7aEory2eHl167eN1Pi0k-k/edit?usp=sharing

prostil commented 5 years ago

This is not a must for Barcelona hence removing th lable