bozo: increase salvage instance poll rate

Increase the bos client poll rate of the salvager temporary bnode
instance status, from every 5 seconds to 1 second.  This reduces the
minimum time bos salvage takes, from 5 seconds to 1 second, which
can add up when doing a large number of volume salvages.

Change-Id: Ia0f48bfabae9442ab0f1b4a6f43df34699892f66
Reviewed-on: http://gerrit.openafs.org/7231
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Michael Meffie 2012-04-16 22:29:24 -04:00 committed by Derrick Brashear
parent 200a02f69a
commit 2460e132a9

View File

@ -1144,6 +1144,7 @@ DoSalvage(struct rx_connection * aconn, char * aparm1, char * aparm2,
char pbuffer[PARMBUFFERSSIZE]; char pbuffer[PARMBUFFERSSIZE];
afs_int32 partNumber; afs_int32 partNumber;
char *notifier = NONOTIFIER; char *notifier = NONOTIFIER;
int count;
/* if a partition was specified, canonicalize the name, since /* if a partition was specified, canonicalize the name, since
* the salvager has a stupid partition ID parser */ * the salvager has a stupid partition ID parser */
@ -1314,12 +1315,14 @@ DoSalvage(struct rx_connection * aconn, char * aparm1, char * aparm2,
goto done; goto done;
} }
/* now wait for bnode to disappear */ /* now wait for bnode to disappear */
count = 0;
while (1) { while (1) {
IOMGR_Sleep(5); IOMGR_Sleep(1);
tp = tbuffer; tp = tbuffer;
code = BOZO_GetInstanceInfo(aconn, "salvage-tmp", &tp, &istatus); code = BOZO_GetInstanceInfo(aconn, "salvage-tmp", &tp, &istatus);
if (code) if (code)
break; break;
if ((++count % 5) == 0)
printf("bos: waiting for salvage to complete.\n"); printf("bos: waiting for salvage to complete.\n");
} }
if (code != BZNOENT) { if (code != BZNOENT) {