ubik-dont-serve-data-while-syncing-20030927

while we're syncing a new database over, and if the sync fails, don't keep
serving out of the truncated and/or trashed database. set the db version to 0
before starting the sync.
This commit is contained in:
Kris Van Hees 2003-09-27 07:23:30 +00:00 committed by Derrick Brashear
parent d4d4680f40
commit 161a1f6509

View File

@ -538,6 +538,7 @@ SDISK_SendFile(rxcall, file, length, avers)
tversion.epoch = 0; /* start off by labelling in-transit db as invalid */ tversion.epoch = 0; /* start off by labelling in-transit db as invalid */
tversion.counter = 0; tversion.counter = 0;
(*dbase->setlabel) (dbase, file, &tversion);/* setlabel does sync */ (*dbase->setlabel) (dbase, file, &tversion);/* setlabel does sync */
memcpy(&ubik_dbase->version, &tversion, sizeof(struct ubik_version));
while (length > 0) { while (length > 0) {
tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length); tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length);
code = rx_Read(rxcall, tbuffer, tlen); code = rx_Read(rxcall, tbuffer, tlen);