Partial implementation of ringbuffer for in-memory long, among other things.

This commit is contained in:
Sears Russell 2005-03-08 07:53:53 +00:00
parent 030ddeb31f
commit e22d4b8e59
5 changed files with 7 additions and 14 deletions

View file

@ -108,29 +108,17 @@ lsn_t LogTransAbort(TransactionLog * l);
LogUpdate writes an UPDATE log record to the log tail
*/
LogEntry * LogUpdate(TransactionLog * l, Page * p, recordid rid, int operation, const byte * args);
/* *
(Was folded into LogUpdate.)
Logs the fact that a rid has been allocated for a transaction.
@ todo Should this be folded into LogUpdate? (Make "alloc" an operation...)
@ todo Surely, we need a dealloc!
*/
/*lsn_t LogTransAlloc(TransactionLog * l, recordid rid);*/
/**
Write a compensation log record. These records are used to allow
for efficient recovery, and possibly for log truncation. They
record the completion of undo operations.
record the completion of undo operations, amongst other things.
@return the lsn of the CLR entry that was written to the log.
(Needed so that the lsn slot of the page in question can be
updated.)
@todo Remove this from this interface? Should it be internal to
the recovery routines?
*/
lsn_t LogCLR (LogEntry * undone); /*TransactionLog * l, long ulLSN, recordid ulRID, long ulPrevLSN); */
lsn_t LogCLR (LogEntry * undone);
/**
Write a end transaction record @see XEND

View file

@ -7,6 +7,7 @@ liblladd_a_SOURCES=crc32.c common.c stats.c io.c bufferManager.c linkedlist.c op
pageFile.c pageCache.c page.c blobManager.c recovery2.c transactional2.c \
lockManager.c \
logger/logEntry.c logger/logWriter.c logger/logHandle.c logger/logger2.c \
logger/logMemory.c \
page/slotted.c page/header.c page/fixed.c compensations.c \
operations/pageOperations.c page/indirect.c operations/decrement.c \
operations/increment.c operations/prepare.c operations/set.c \

View file

@ -287,6 +287,7 @@ void allocBlob(int xid, Page * p, lsn_t lsn, recordid rid) {
fdatasync(fileno(blobf0));
fdatasync(fileno(blobf1));
#else
#warn Not using fdatasync
fsync(fileno(blobf0));
fsync(fileno(blobf1));
#endif
@ -433,6 +434,7 @@ void writeBlob(int xid, Page * p, lsn_t lsn, recordid rid, const void * buf) {
#ifdef HAVE_FDATASYNC
fdatasync(fileno(fd));
#else
#warn Not using fdatasync()
fsync(fileno(fd));
#endif

View file

@ -163,6 +163,7 @@ void pageInit() {
int ret = posix_memalign((void*)(&(pool[i].memAddr)), PAGE_SIZE, PAGE_SIZE);
assert(!ret);
#else
#warn Not using posix_memalign
pool[i].memAddr = malloc(PAGE_SIZE);
assert(pool[i].memAddr);
#endif

View file

@ -133,6 +133,7 @@ void openPageFile() {
// O_DIRECT is broken under linux 2.4..
stable = open (STORE_FILE, O_CREAT | O_RDWR /*| O_DIRECT*/, S_IRWXU | S_IRWXG | S_IRWXO);
#else
#warn Not using O_DIRECT
// If we don't have posix_memalign(), then we aren't aligning our pages in memory, and can't use O_DIRECT.
stable = open (STORE_FILE, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO);
#endif