reduce the risk that broken calls to Tset() will create unrecoverable logs
This commit is contained in:
parent
db4f26b48c
commit
c76f22fd4f
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue