From 4afe95cda7473642a50027b07785e7e6b2ed66a5 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Wed, 1 Oct 2008 15:57:29 +0000 Subject: [PATCH] unit test was setting page lsns to invalid values, breaking truncation --- test/stasis/check_bufferManager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/stasis/check_bufferManager.c b/test/stasis/check_bufferManager.c index c632ad8..fe7a9f3 100644 --- a/test/stasis/check_bufferManager.c +++ b/test/stasis/check_bufferManager.c @@ -141,8 +141,11 @@ void * workerThreadWriting(void * q) { writelock(p->rwlatch,0); /* sched_yield(); */ 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); + lsn_t lsn = stasis_page_lsn_read(p); + assert(lsn); + p->LSN --; // XXX HACK -- Sooner or later this will break... + stasis_record_write(1, p, lsn, rids[i], (byte*)&val); + stasis_page_lsn_write(1,p,lsn); unlock(p->rwlatch); assert(p->id == rids[i].page);