Fixed bug in check_bufferManager.c. It wasn't marking pages dirty or setting LSN's.

This commit is contained in:
Sears Russell 2008-09-30 17:49:39 +00:00
parent db1d79efcd
commit defbcbfde1

View file

@ -21,11 +21,11 @@
#else
#define THREAD_COUNT 25
#define NUM_PAGES (MAX_BUFFER_SIZE * 3)
#define NUM_PAGES ((MAX_BUFFER_SIZE * 3)/2)
#define PAGE_MULT 1000
#define READS_PER_THREAD (NUM_PAGES * 5)
#define RECORDS_PER_THREAD (NUM_PAGES * 5)
#define READS_PER_THREAD (NUM_PAGES * 2)
#define RECORDS_PER_THREAD (NUM_PAGES * 2)
#endif
@ -59,6 +59,7 @@ void initializePages() {
stasis_record_alloc_done(-1, p, rid);
int * buf = (int*)stasis_record_write_begin(-1, p, rid);
*buf = i;
stasis_record_write_done(-1,p,rid,(void*)buf);
stasis_page_lsn_write(-1, p, 0);
unlock(p->rwlatch);
releasePage(p);
@ -139,7 +140,9 @@ void * workerThreadWriting(void * q) {
}
writelock(p->rwlatch,0);
/* sched_yield(); */
stasis_record_write(1, p, 0, rids[i], (byte*)&val);
assert(stasis_record_length_read(xid,p,rids[i]) == sizeof(int));
stasis_record_write(1, p, p->LSN+1, rids[i], (byte*)&val);
stasis_page_lsn_write(1,p,p->LSN+1);
unlock(p->rwlatch);
assert(p->id == rids[i].page);
@ -157,8 +160,9 @@ void * workerThreadWriting(void * q) {
p = loadPage(xid, rids[i].page);
assert(p->id == rids[i].page);
writelock(p->rwlatch,0);
assert(stasis_record_length_read(xid,p,rids[i]) == sizeof(int));
stasis_record_read(1, p, rids[i], (byte*)&val);
unlock(p->rwlatch);