fix nested top action log race; because of a refactoring mistake, it was releasing a mutex without acquiring it...

This commit is contained in:
Sears Russell 2010-01-21 20:27:35 +00:00
parent 9dba8770f0
commit dbf253275f
3 changed files with 3 additions and 6 deletions

View file

@ -113,7 +113,7 @@ LogEntry * stasis_log_write_update(stasis_log_t* log, stasis_transaction_table_e
return e; return e;
} }
// XXX change nta interface so that arg gets passed into end_nta, not begin_nta. // XXX change nta interface so that arg gets passed into end_nta, not begin_nta.
LogEntry * stasis_log_begin_nta(stasis_log_t* log, stasis_transaction_table_entry_t * l, unsigned int op, void * stasis_log_begin_nta(stasis_log_t* log, stasis_transaction_table_entry_t * l, unsigned int op,
const byte * arg, size_t arg_size) { const byte * arg, size_t arg_size) {
LogEntry * e = mallocScratchUpdateLogEntry(INVALID_LSN, l->prevLSN, l->xid, op, INVALID_PAGE, arg_size); LogEntry * e = mallocScratchUpdateLogEntry(INVALID_LSN, l->prevLSN, l->xid, op, INVALID_PAGE, arg_size);
memcpy(stasis_log_entry_update_args_ptr(e), arg, arg_size); memcpy(stasis_log_entry_update_args_ptr(e), arg, arg_size);

View file

@ -418,10 +418,7 @@ int TnestedTopAction(int xid, int op, const byte * dat, size_t datSize) {
void * TbeginNestedTopAction(int xid, int op, const byte * dat, int datSize) { void * TbeginNestedTopAction(int xid, int op, const byte * dat, int datSize) {
assert(xid >= 0); assert(xid >= 0);
LogEntry * e = stasis_log_begin_nta(stasis_log_file, stasis_transaction_table_get(stasis_transaction_table, xid), op, dat, datSize); void * ret = stasis_log_begin_nta(stasis_log_file, stasis_transaction_table_get(stasis_transaction_table, xid), op, dat, datSize);
LogEntry * ret = malloc(sizeofLogEntry(stasis_log_file, e));
memcpy(ret, e, sizeofLogEntry(stasis_log_file, e));
stasis_log_file->write_entry_done(stasis_log_file, e);
DEBUG("Begin Nested Top Action e->LSN: %ld\n", e->LSN); DEBUG("Begin Nested Top Action e->LSN: %ld\n", e->LSN);
return ret; return ret;
} }

View file

@ -327,7 +327,7 @@ lsn_t stasis_log_write_clr(stasis_log_t* log, const LogEntry * e);
lsn_t stasis_log_write_dummy_clr(stasis_log_t* log, int xid, lsn_t prev_lsn); lsn_t stasis_log_write_dummy_clr(stasis_log_t* log, int xid, lsn_t prev_lsn);
LogEntry * stasis_log_begin_nta(stasis_log_t* log, stasis_transaction_table_entry_t * l, unsigned int op, void * stasis_log_begin_nta(stasis_log_t* log, stasis_transaction_table_entry_t * l, unsigned int op,
const byte * arg, size_t arg_size); const byte * arg, size_t arg_size);
lsn_t stasis_log_end_nta(stasis_log_t* log, stasis_transaction_table_entry_t * l, LogEntry * e); lsn_t stasis_log_end_nta(stasis_log_t* log, stasis_transaction_table_entry_t * l, LogEntry * e);
#endif #endif