pull multiops outside of the log latch. (how embarassing...)

This commit is contained in:
Sears Russell 2010-06-15 23:12:38 +00:00
parent d4804bd926
commit f376d46090

View file

@ -157,9 +157,26 @@ void Tupdate(int xid, pageid_t page,
assert(xact->prevLSN == e->LSN); assert(xact->prevLSN == e->LSN);
DEBUG("Tupdate() e->LSN: %ld\n", e->LSN); DEBUG("Tupdate() e->LSN: %ld\n", e->LSN);
stasis_operation_do(e, p); LogEntry * multiE = 0;
if(page == MULTI_PAGEID) {
size_t len = sizeofLogEntry(stasis_log_file, e);
multiE = malloc(len);
memcpy(multiE, e, len);
} else {
stasis_operation_do(e, p);
}
stasis_log_file->write_entry_done(stasis_log_file, e); stasis_log_file->write_entry_done(stasis_log_file, e);
if(page == MULTI_PAGEID) {
// Note: This is not atomic with the log entry. MULTI operations are a special case of segments.
// We assume that any concurrent updates to the backing pages commute with this operation.
// For this to be true, either:
// (a) the pages must not have LSNs in their headers, or
// (b) we must have an implicit latch (which should be the case for allocation requests).
stasis_operation_do(multiE, 0);
free(multiE);
}
if(p) unlock(p->rwlatch); if(p) unlock(p->rwlatch);
if(p) releasePage(p); if(p) releasePage(p);
} }