]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vol: remove SYNC fatal_error processing
authorAndrew Deason <adeason@sinenomine.net>
Fri, 13 Jan 2012 18:43:16 +0000 (13:43 -0500)
committerDerrick Brashear <shadow@dementix.org>
Tue, 24 Jan 2012 02:30:24 +0000 (18:30 -0800)
Currently SYNC clients will "disable" themselves on certain error
patterns. For example, if the server end closes its file descriptor
too many times, or takes too long and then closes the fd, the SYNC
client will return an error and set fatal_error. On any subsequent
SYNC requests, the request will immediately fail without contacting
the server, often making SYNC client programs effectively useless
until they are restarted.

There isn't really any reason to cause future requests to fail.
Transient problems in the fileserver can easily make this situation
possible (e.g. a fileserver can crash but still take several minutes
to close the SYNC fd while the core is written to disk), and so while
we may return an error for a specific problematic request, future
requests may be fine.

So, just remove everything related to fatal_error, so future SYNC
requests can continue to be attempted. Adjust some log messages to
reflect the new behavior.

Reviewed-on: http://gerrit.openafs.org/6548
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 40bf6dee2409197f7494c3d09bf2dea7c248d185)

Change-Id: I0f7a1792afd1ace3beabe238107d0a5069ccbb44
Reviewed-on: http://gerrit.openafs.org/6609
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/vol/daemon_com.c
src/vol/daemon_com.h
src/vol/fssync-client.c
src/vol/salvsync-client.c

index 26d5cb7c8e9da0159bc4f21a2a2e3c7ac2f4114b..acb7360af18fe9f6ca57812484164305cfb0c4f6 100644 (file)
@@ -275,16 +275,11 @@ SYNC_ask(SYNC_client_state * state, SYNC_command * com, SYNC_response * res)
     int tries;
     afs_uint32 now, timeout, code=SYNC_OK;
 
-    if (state->fatal_error) {
-       return SYNC_COM_ERROR;
-    }
-
     if (state->fd == OSI_NULLSOCKET) {
        SYNC_connect(state);
     }
 
     if (state->fd == OSI_NULLSOCKET) {
-       state->fatal_error = 1;
        return SYNC_COM_ERROR;
     }
 
@@ -320,10 +315,9 @@ SYNC_ask(SYNC_client_state * state, SYNC_command * com, SYNC_response * res)
     }
 
     if (code == SYNC_COM_ERROR) {
-       Log("SYNC_ask: fatal protocol error on circuit '%s'; disabling sync "
-           "protocol until next server restart\n",
-           state->proto_name);
-       state->fatal_error = 1;
+       Log("SYNC_ask: too many / too latent fatal protocol errors on circuit "
+           "'%s'; giving up (tries %d timeout %d)\n",
+           state->proto_name, tries, timeout);
     }
 
     return code;
index 249c270da8af7982446101c0e4ddd94a312c80a7..dabaf3b578e0423f95992c0129a29130258b7a4a 100644 (file)
@@ -144,7 +144,6 @@ typedef struct SYNC_client_state {
     int retry_limit;            /**< max number of times for SYNC_ask to retry */
     afs_int32 hard_timeout;     /**< upper limit on time to keep trying */
     char * proto_name;          /**< sync protocol associated with this conn */
-    byte fatal_error;           /**< nonzero if fatal error on this client conn */
     afs_uint32 pkt_seq;         /**< packet xmit sequence counter */
     afs_uint32 com_seq;         /**< command xmit sequence counter */
 } SYNC_client_state;
index be0a0ad631afb54fde1a8c6cd9a95c1e3ce66215..7339de944804e9df3ebfae0c70d36daa1f36c545 100644 (file)
@@ -132,7 +132,7 @@ FSYNC_askfs(SYNC_command * com, SYNC_response * res)
        break;
     case SYNC_COM_ERROR:
     case SYNC_BAD_COMMAND:
-       Log("FSYNC_askfs: fatal FSSYNC protocol error; volume management functionality disabled until next fileserver restart\n");
+       Log("FSYNC_askfs: internal FSSYNC protocol error %d\n", code);
        break;
     case SYNC_DENIED:
        Log("FSYNC_askfs: FSSYNC request denied for reason=%d\n", res->hdr.reason);
index 84d65ed4387acf33390014d1116d804d4191b043..b625c885e2268522ba7d4b75d2d12c91eeea0b73 100644 (file)
@@ -108,7 +108,7 @@ SALVSYNC_askSalv(SYNC_command * com, SYNC_response * res)
       break;
     case SYNC_COM_ERROR:
     case SYNC_BAD_COMMAND:
-       Log("SALVSYNC_askSalv: fatal SALVSYNC protocol error; online salvager functionality disabled until next fileserver restart\n");
+       Log("SALVSYNC_askSalv: internal SALVSYNC protocol error %d\n", code);
        break;
     case SYNC_DENIED:
        Log("SALVSYNC_askSalv: SALVSYNC request denied for reason=%d\n", res->hdr.reason);