Commit f1a4cb8c authored by gerd's avatar gerd

more debug output


git-svn-id: https://gps.dynxs.de/private/svn/app-plasma/trunk@255 55289a75-7b90-4627-9e07-ffb4263930b2
parent ce297df9
......@@ -66,8 +66,12 @@ let commit_phase1_write_remotely slave journal shared_state rev_id =
(fun m ->
if !enabled then
Nn_push.push_e m mclient
else
else (
Netlog.logf `Warning
"commit_phase1_write_remotely still running \
although slave disabled";
eps_e (`Done ()) esys
)
)
)
>> (function
......
......@@ -296,6 +296,10 @@ let get_next_st_id() =
Int64_var.set st_id_name next_st_id;
next_st_id
let sess_peer sess =
try Netsys.string_of_sockaddr
(Rpc_server.get_peer_name sess)
with _ -> "n/a"
let new_transaction_e sess tid =
let sh = get_shared() in
......@@ -315,6 +319,9 @@ let new_transaction_e sess tid =
pending_abort = false;
} in
Hashtbl.replace transtbl (cid,tid) fstr;
Netlog.logf `Debug
"New transaction %Ld (peer %s)"
tid (sess_peer sess);
eps_e (`Done fstr) sh#event_system
with error ->
eps_e (`Error error) sh#event_system
......@@ -459,9 +466,13 @@ let with_transaction_1 rpc_srv_reply procname sess emit tid f =
e1
)
trans
| None ->
| None -> (
(** There is no transaction yet *)
Netlog.logf `Debug
"ENOTRANS for transaction %Ld (peer %s)"
tid (sess_peer sess);
emit `enotrans
)
let with_transaction procname =
with_transaction_1 fs_rpc_srv_reply procname
......@@ -616,6 +627,9 @@ let proc_commit_transaction sess tid emit =
(map_e
~map_done:(fun v ->
del_transaction cid tid;
Netlog.logf `Debug
"Committed transaction %Ld (peer %s)"
tid (sess_peer sess);
`Done v
)
(delete_inodes_e
......@@ -651,6 +665,9 @@ let proc_abort_transaction sess tid emit =
(* FIXME: better we could allow this *)
emit `etbusy
else (
Netlog.logf `Debug
"Aborted transaction %Ld (peer %s)"
tid (sess_peer sess);
trans.running <- true;
del_transaction cid tid;
trans.bm_view # rollback();
......
......@@ -521,6 +521,17 @@ let find_coord_e c =
)
let mc_info mc =
let s =
match Rpc_proxy.ManagedClient.mclient_state mc with
| `Down -> "down"
| `Connecting -> "connecting"
| `Up None -> "up(n/a)"
| `Up (Some addr) -> "up(" ^ Netsys.string_of_sockaddr addr ^ ")" in
sprintf "mclient(serial=%d,state=%s)"
(Rpc_proxy.ManagedClient.mclient_serial mc) s
let with_nn_session_e c f =
(** Run [f mc] for a managed client [mc] of the namenode *)
if c.down then
......@@ -557,9 +568,12 @@ let with_nn_session_e c f =
)
)
++ (fun mc ->
Netlog.logf `Debug
"with_nn_session: %s" (mc_info 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.
......@@ -615,6 +629,8 @@ let with_new_nn_transaction_e c mc extract f =
failwith "Plasma_client: already closed";
let tid = c.next_tid in
c.next_tid <- Int64.succ tid;
Netlog.logf `Debug
"with_new_nn_transaction: tid=%Ld %s" tid (mc_info mc);
Util.rpc_engine mc Fsys.V1.begin_transaction'async tid
++
(function
......@@ -634,7 +650,13 @@ let with_new_nn_transaction_e c mc extract f =
new Uq_engines.map_engine
~map_done:(function
| `ok -> `Done x'
| #errno as e -> `Error(Plasma_error e)
| #errno as e ->
Netlog.logf `Debug
"with_new_nn_transaction: \
commit error tid=%Ld %s exn: %s"
tid (mc_info mc)
(Plasma_util.string_of_errno e);
`Error(Plasma_error e)
)
(Util.rpc_engine
mc Fsys.V1.commit_transaction'async tid)
......@@ -649,6 +671,9 @@ let with_new_nn_transaction_e c mc extract f =
Check if [mc] is already down, and do not open it
for only aborting.
*)
Netlog.logf `Debug
"with_new_nn_transaction: abort tid=%Ld %s exn: %s"
tid (mc_info mc) (Netexn.to_string err);
let st1 = `Error err in
( match Rpc_proxy.ManagedClient.mclient_state mc with
| `Down ->
......@@ -661,6 +686,9 @@ let with_new_nn_transaction_e c mc extract f =
)
)
| #errno as e ->
Netlog.logf `Debug
"with_new_nn_transaction: start error tid=%Ld %s exn: %s"
tid (mc_info mc) (Plasma_util.string_of_errno e);
eps_e (`Error (Plasma_error e)) c.esys
)
......
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