Fixed bug in check_bufferManager.c. It wasn't marking pages dirty or setting LSN's.
This commit is contained in:
parent
db1d79efcd
commit
defbcbfde1
1 changed files with 14 additions and 10 deletions
|
@ -21,11 +21,11 @@
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define THREAD_COUNT 25
|
#define THREAD_COUNT 25
|
||||||
#define NUM_PAGES (MAX_BUFFER_SIZE * 3)
|
#define NUM_PAGES ((MAX_BUFFER_SIZE * 3)/2)
|
||||||
#define PAGE_MULT 1000
|
#define PAGE_MULT 1000
|
||||||
|
|
||||||
#define READS_PER_THREAD (NUM_PAGES * 5)
|
#define READS_PER_THREAD (NUM_PAGES * 2)
|
||||||
#define RECORDS_PER_THREAD (NUM_PAGES * 5)
|
#define RECORDS_PER_THREAD (NUM_PAGES * 2)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ void initializePages() {
|
||||||
stasis_record_alloc_done(-1, p, rid);
|
stasis_record_alloc_done(-1, p, rid);
|
||||||
int * buf = (int*)stasis_record_write_begin(-1, p, rid);
|
int * buf = (int*)stasis_record_write_begin(-1, p, rid);
|
||||||
*buf = i;
|
*buf = i;
|
||||||
|
stasis_record_write_done(-1,p,rid,(void*)buf);
|
||||||
stasis_page_lsn_write(-1, p, 0);
|
stasis_page_lsn_write(-1, p, 0);
|
||||||
unlock(p->rwlatch);
|
unlock(p->rwlatch);
|
||||||
releasePage(p);
|
releasePage(p);
|
||||||
|
@ -139,7 +140,9 @@ void * workerThreadWriting(void * q) {
|
||||||
}
|
}
|
||||||
writelock(p->rwlatch,0);
|
writelock(p->rwlatch,0);
|
||||||
/* sched_yield(); */
|
/* 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);
|
unlock(p->rwlatch);
|
||||||
|
|
||||||
assert(p->id == rids[i].page);
|
assert(p->id == rids[i].page);
|
||||||
|
@ -157,8 +160,9 @@ void * workerThreadWriting(void * q) {
|
||||||
|
|
||||||
|
|
||||||
p = loadPage(xid, rids[i].page);
|
p = loadPage(xid, rids[i].page);
|
||||||
|
assert(p->id == rids[i].page);
|
||||||
writelock(p->rwlatch,0);
|
writelock(p->rwlatch,0);
|
||||||
|
assert(stasis_record_length_read(xid,p,rids[i]) == sizeof(int));
|
||||||
stasis_record_read(1, p, rids[i], (byte*)&val);
|
stasis_record_read(1, p, rids[i], (byte*)&val);
|
||||||
unlock(p->rwlatch);
|
unlock(p->rwlatch);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue