Fixed blob bug. The reason it's so slow is that it's logging a preimage + postimage of each blob and then synchronously writing to a second copy each time the blob is

written to(!!!)
This commit is contained in:
Sears Russell 2006-06-20 00:03:38 +00:00
parent 3e4cac0fe3
commit e14877821f
3 changed files with 13 additions and 3 deletions

View file

@ -436,7 +436,7 @@ void writeBlob(int xid, Page * p, lsn_t lsn, recordid rid, const void * buf) {
files when it's called (are there any dirty blobs associated with
this transaction?
@todo when writeBlob is fixed, add the fdatasync calls back into commitBlobs().
@todo when writeBlob is fixed, add the fdatasync calls back into commitBlobs() Currently, it calls fdatasync on each blob write...
*/
void commitBlobs(int xid) {
flockfile(blobf1);

View file

@ -230,6 +230,8 @@ recordid slottedRawRalloc(Page * page, int size) {
- If 11 was also deleted by a transaction that could abort, we should lock it so that it won't be reused.
(4) This function adds it to the freelist to avoid leaking space. (Therefore, Talloc() can return recordids that will
be reused by aborting transactions...)
@param rid Recordid with 'internal' size. The size should have already been translated to a type if necessary.
*/
static void really_do_ralloc(Page * page, recordid rid) {
@ -333,7 +335,9 @@ static void really_do_ralloc(Page * page, recordid rid) {
//}
}
/**
@param rid with user-visible size.
*/
recordid slottedPostRalloc(int xid, Page * page, lsn_t lsn, recordid rid) {
writelock(page->rwlatch, 376);
@ -368,7 +372,11 @@ recordid slottedPostRalloc(int xid, Page * page, lsn_t lsn, recordid rid) {
// Make sure the slot is invalid. If the slot has not been used yet, then
// slot_length_ptr will still be zero, so we allow that too.
if((*slot_length_ptr(page, rid.slot) == 0) || (*slot_ptr(page, rid.slot) == INVALID_SLOT)) {
really_do_ralloc(page, rid);
recordid rid2 = rid;
if(rid.size >= BLOB_THRESHOLD_SIZE) {
rid2.size = BLOB_SLOT;
}
really_do_ralloc(page, rid2);
} else {

View file

@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include <config.h>
#ifndef HAVE_TCASE_SET_TIMEOUT
@ -13,5 +14,6 @@ void setup (void) {
}
void teardown(void) {
system("ls -lh *.txt*");
setup();
}