Commit 68689d4d authored by gerd's avatar gerd

trying to avoid race


git-svn-id: https://gps.dynxs.de/private/svn/app-plasma/trunk@253 55289a75-7b90-4627-9e07-ffb4263930b2
parent c5829bbd
......@@ -153,6 +153,10 @@ type plasma_cluster =
mutable coord : Unix.sockaddr;
(** Current coordinator *)
mutable find_coord_ser :
Rpc_proxy.ManagedClient.mclient Uq_engines.serializer_t;
(** Serializer for the coordinator search *)
mutable next_tid : int64;
(** next transaction ID *)
......@@ -366,6 +370,7 @@ let open_cluster name nodes esys =
pref_nodes = [];
shm_mng = new Plasma_shm.null_shm_manager();
coord = namenodes.(0);
find_coord_ser = Uq_engines.serializer esys;
next_tid = 0L;
blocksize = 0;
clients = MCSet.empty;
......@@ -524,25 +529,37 @@ let with_nn_session_e c f =
| Some mc when Rpc_proxy.ManagedClient.mclient_state mc <> `Down ->
f mc
| _ ->
find_coord_e c
c.nn_client_opt <- None;
c.find_coord_ser # serialized
(fun _ ->
match c.nn_client_opt with
| Some mc ->
eps_e (`Done mc) c.esys
| _ ->
find_coord_e c
++ (fun mc ->
c.nn_client_opt <- Some mc;
Util.rpc_engine mc Fsys.V1.get_blocksize'async ()
++ (fun size ->
if c.blocksize = 0 then
c.blocksize <- size;
if c.blocksize <> size then (
Netlog.logf `Crit
"After reconnecting the namenode reports a \
different blocksize";
eps_e
(`Error (Failure "blocksize mismatch"))
c.esys
)
else
eps_e (`Done mc) c.esys
)
)
)
++ (fun mc ->
c.nn_client_opt <- Some mc;
Util.rpc_engine mc Fsys.V1.get_blocksize'async ()
++ (fun size ->
if c.blocksize = 0 then
c.blocksize <- size;
if c.blocksize <> size then (
Netlog.logf `Crit
"After reconnecting the namenode reports a \
different blocksize";
eps_e (`Error (Failure "blocksize mismatch")) c.esys
)
else
f mc
)
f mc
)
let dn_session_e c (h,p) =
(** Create/continue a session to the datanode [hp], and start the engine
[f mc]. Returns the engine.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment