From e0347526dd77f7171ae9da72fc92ca99a79dd282 Mon Sep 17 00:00:00 2001 From: Pavan Sondur Date: Thu, 12 Aug 2010 04:49:15 +0000 Subject: cluster/pump: Dynamically control sink connect and disconnect. Signed-off-by: Pavan Vilas Sondur Signed-off-by: Anand V. Avati BUG: 1303 (Cleanup replace-brick state info) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1303 --- xlators/cluster/afr/src/pump.h | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'xlators/cluster/afr/src/pump.h') diff --git a/xlators/cluster/afr/src/pump.h b/xlators/cluster/afr/src/pump.h index 15799002b..e786fb0de 100644 --- a/xlators/cluster/afr/src/pump.h +++ b/xlators/cluster/afr/src/pump.h @@ -22,6 +22,10 @@ #include "syncop.h" +/* FIXME: Needs to be defined in a common file */ +#define CLIENT_CMD_CONNECT "trusted.glusterfs.client-connect" +#define CLIENT_CMD_DISCONNECT "trusted.glusterfs.client-disconnect" + #define PUMP_PID 696969 #define PUMP_LK_OWNER 696969 @@ -43,23 +47,23 @@ #define PUMP_SINK_CHILD(xl) (xl->children->next->xlator) typedef enum { - PUMP_STATE_RUNNING, - PUMP_STATE_RESUME, - PUMP_STATE_PAUSE, - PUMP_STATE_ABORT, + PUMP_STATE_RUNNING, /* Pump is running and migrating files */ + PUMP_STATE_RESUME, /* Pump is resuming from a previous pause */ + PUMP_STATE_PAUSE, /* Pump is paused */ + PUMP_STATE_ABORT, /* Pump is aborted */ } pump_state_t; typedef struct _pump_private { - struct syncenv *env; - const char *resume_path; - gf_lock_t resume_path_lock; - gf_lock_t pump_state_lock; - pump_state_t pump_state; - long source_blocks; - long sink_blocks; - char current_file[PATH_MAX]; - uint64_t number_files_pumped; - gf_boolean_t pump_finished; + struct syncenv *env; /* The env pointer to the pump synctask */ + const char *resume_path; /* path to resume from the last pause */ + gf_lock_t resume_path_lock; /* Synchronize resume_path changes */ + gf_lock_t pump_state_lock; /* Synchronize pump_state changes */ + pump_state_t pump_state; /* State of pump */ + char current_file[PATH_MAX]; /* Current file being pumped */ + uint64_t number_files_pumped; /* Number of files pumped */ + gf_boolean_t pump_finished; /* Boolean to indicate pump termination */ + char pump_start_pending; /* Boolean to mark start pending until + CHILD_UP */ } pump_private_t; void -- cgit