reduce the risk that broken calls to Tset() will create unrecoverable logs

This commit is contained in:
Sears Russell 2008-10-23 20:27:08 +00:00
parent db4f26b48c
commit c76f22fd4f

View file

@ -94,11 +94,16 @@ int Tset(int xid, recordid rid, const void * dat) {
readlock(p->rwlatch,0);
rid = stasis_record_dereference(xid,p,rid);
rid.size = stasis_record_type_to_size(rid.size);
if(rid.size > BLOB_THRESHOLD_SIZE) {
writeBlob(xid,p,rid,dat);
unlock(p->rwlatch);
releasePage(p);
} else {
if(rid.page == p->id) {
// failing early avoids unrecoverable logs...
assert(rid.size == stasis_record_length_read(xid, p, rid));
}
unlock(p->rwlatch);
releasePage(p);