- Arrange for buffer manager writback to use group commit

- Only call correct log force when log_to_mem is enabled.
This commit is contained in:
Sears Russell 2008-12-01 04:28:46 +00:00
parent 1cddd8ab8c
commit 77b24a991d

View file

@ -119,19 +119,6 @@ int LogDeinit() {
return 0;
}
void LogForce(lsn_t lsn) {
lsn_t flushedLSN = LogFlushedLSN();
if(flushedLSN < lsn) {
if(LOG_TO_FILE == loggerType) {
syncLog_LogWriter();
} else if (LOG_TO_MEMORY == loggerType) {
syncLog_InMemoryLog();
} else {
abort();
}
}
assert(LogFlushedLSN() >= lsn);
}
void LogTruncate(lsn_t lsn) {
if(LOG_TO_FILE == loggerType) {
truncateLog_LogWriter(lsn);
@ -288,7 +275,14 @@ static void groupForce(lsn_t l) {
}
}
if(LogFlushedLSN() < l) {
syncLog_LogWriter();
if(LOG_TO_FILE == loggerType) {
syncLog_LogWriter();
} else if (LOG_TO_MEMORY == loggerType) {
syncLog_InMemoryLog();
} else {
abort();
}
assert(LogFlushedLSN() >= lsn);
syncLogCount++;
pthread_cond_broadcast(&tooFewXacts);
}
@ -309,6 +303,9 @@ static lsn_t groupPrepare(TransactionLog * l) {
return ret;
}
void LogForce(lsn_t lsn) {
groupForce(lsn);
}
lsn_t LogTransCommit(TransactionLog * l) {
return groupCommit(l);
}