-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Learner node #210
Learner node #210
Conversation
@@ -144,7 +144,7 @@ def copyDirTree(self,src,dst): | |||
|
|||
root = os.environ.get('TEST_HOME') | |||
if root is None: | |||
root = os.environ['HOME'] | |||
raise Exception("TEST_HOME is undefined") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
impact on travis/jenkins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea, but after cleaning my home directory several times I believe this is the right thing to do.
src/paxos/learner.ml
Outdated
@@ -0,0 +1,203 @@ | |||
(* | |||
Copyright (2010-2014) INCUBAID BVBA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably move to a copyright notice like the one in Alba. I think it's not acceptable to attribute copyright to someone who didn't create it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
src/paxos/learner.ml
Outdated
let sides = | ||
if is_election constants | ||
then [log_e; EStartElectionTimeout (current_n, current_i); mcast_e] | ||
else [log_e; mcast_e] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
factor out common [log_e; mcast_e] ?
src/paxos/learner.ml
Outdated
end | ||
| ElectionTimeout _ | LeaseExpired _ -> | ||
let log_e = ELog (fun () -> | ||
Printf.sprintf "steady_state: ignoring lease expiration because I am a learner") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sprintf
not needed.
src/paxos/learner.ml
Outdated
Fsm.return (Learner_steady_state (future_n, current_i', None)); | ||
end | ||
else | ||
failwith "FIXME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be impossible maybe replace with some kind of assert ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few minor comments below, but I would like to make a few more general comments too (and perhaps tomorrow have some discussion in the chat):
- this (almost) duplicates a bunch of existing code
- the existing (now duplicated) code contains some logic related to
constants.is_learner
which is now obsolete - should the consensus nodes actually know about the learner nodes? perhaps we could have a design where the learner node subscribes to the stream of updates instead (in which case it can even choose which node it wants to follow - e.g. it could follow the master, or some slave in the same datacenter)
src/paxos/multi_paxos_fsm.ml
Outdated
@@ -741,6 +744,25 @@ let _execute_effects constants e = | |||
|
|||
(* the entry methods *) | |||
|
|||
let enter_learner ?(stop = ref false) constants buffers new_i = | |||
let me = constants.me in | |||
Logger.debug_f_ "%s: +starting FSM for forced_slave." me >>= fun () -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/forced_slave/learner
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right.
src/paxos/multi_paxos_type.ml
Outdated
|
||
|
||
type learner_transitions = | ||
| Learner_start_transition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this constructor isn't actually used anywhere and could be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't want to test it, then yes.
src/paxos/learner.ml
Outdated
let mcast_e = EMCast fake in | ||
let sides = | ||
if is_election constants | ||
then [log_e; EStartElectionTimeout (current_n, current_i); mcast_e] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should a learner ever produce the EStartElectionTimeout
action? If I'm not mistaken it will ignore the resulting ElectionTimeout
event anyway...
(so I think the if
can go away)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm suspicious about elections too. We've discussed with Romain this yesterday.
this can be done, but it should not be named "learner" |
bc174e3
to
8153645
Compare
This is still a work in progress. Your comments are very much appreciated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(github can't show changes to slave.ml)
src/paxos/learner.ml
Outdated
let handle_from_node ((n,i,previous) as state) (type s) (module S : Store.STORE with type t = s) | ||
{store; me;on_witness} msg source = | ||
Logger.ign_debug_f_ "Learner.steady_state n:%s i:%s v:%s store_i:%Li got %S from %s" | ||
(Sn.string_of n) (Sn.string_of i) (match previous with Some v -> "Some " ^ Value.value2s v | None -> "None") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's To_string.option
src/paxos/learner.ml
Outdated
@@ -0,0 +1,129 @@ | |||
(* | |||
Copyright (C) iNuron - info@openvstorage.com | |||
This file is part of Open vStorage. For license information, see <OVS_LICENSE.txt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just point to the LICENSE file (the apache 2.0)
OVS_LICENSE.TXT
Outdated
@@ -0,0 +1,208 @@ | |||
Open vStorage License Agreement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. all we add keeps being released under Apache 2.0. (see lower)
3550e17
to
a1ff885
Compare
a1ff885
to
64a5690
Compare
No description provided.