]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
CA-42914: Improve debugging in redo-log code
authorJonathan Davies <jonathan.davies@citrix.com>
Thu, 28 Oct 2010 16:00:47 +0000 (17:00 +0100)
committerJonathan Davies <jonathan.davies@citrix.com>
Thu, 28 Oct 2010 16:00:47 +0000 (17:00 +0100)
In particular, highlight the I/O process lifecycle operations.

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
ocaml/database/block_device_io.ml
ocaml/database/redo_log.ml

index 26a88d2fa1dda0d0e8a41919fd74686e76538007..394044f12e7918d686a91375f844ed3100f61c90 100644 (file)
@@ -309,7 +309,7 @@ let transfer_data_from_sock_to_fd sock dest_fd available_space target_response_t
   (* Open the data channel *)
   let s = listen_on sock in
   let data_client = accept_conn s target_response_time in
-  R.debug "Accepted connection on data socket";
+  R.info "Accepted connection on data socket";
   ignore_exn (fun () -> Unix.close s);
 
   (* Read all the data from the data channel, writing it straight into the block device, keeping track of accumulated length *)
@@ -328,6 +328,7 @@ let transfer_data_from_sock_to_fd sock dest_fd available_space target_response_t
     )
     (fun () -> 
       (* Close the connection *)
+      R.info "Closing connection on data socket";
       ignore_exn (fun () -> Unix.close data_client)
     ) in
   R.debug "Finished reading from data socket";
index fc982864cb8b9134efb3fdf610db860424cf040a..17d0386a434ba4dbc367e85c821f5292b4d60dc1 100644 (file)
@@ -452,7 +452,7 @@ let shutdown () =
   
           (* Terminate the child process *)
            let ipid = Forkhelpers.getpid p in
-          R.debug "Killing I/O process with pid %d" ipid;
+          R.info "Killing I/O process with pid %d" ipid;
           Unix.kill ipid Sys.sigkill;
           (* Wait for the process to die. This is done in a separate thread in case it does not respond to the signal immediately. *)
           ignore (Thread.create (fun () ->
@@ -512,11 +512,11 @@ let startup () =
                          
                        (* Start the I/O process *)
                        let [ctrlsockpath; datasockpath] = List.map (fun suffix -> Filename.temp_file Xapi_globs.redo_log_comms_socket_stem suffix) ["ctrl"; "data"] in
-                       R.debug "Starting I/O process with block device [%s], control socket [%s] and data socket [%s]" block_dev ctrlsockpath datasockpath;
+                       R.info "Starting I/O process with block device [%s], control socket [%s] and data socket [%s]" block_dev ctrlsockpath datasockpath;
                        let p = start_io_process block_dev ctrlsockpath datasockpath in
                          
                        pid := Some (p, ctrlsockpath, datasockpath);
-                       R.debug "Block device I/O process has PID [%d]" (Forkhelpers.getpid p)
+                       R.info "Block device I/O process has PID [%d]" (Forkhelpers.getpid p)
                      end
           end
       end;
@@ -576,7 +576,9 @@ let perform_action f desc sock =
     match !pid with 
     | None -> ()
     | Some (_, _, datasockpath) ->
+      R.debug "About to perform action %s" desc;
       f sock datasockpath;
+      R.debug "Action '%s' completed successfully" desc;
       healthy () (* no exceptions: we can be confident that the redo log is working healthily *)
   with
   | Unixext.Timeout ->