From: Wolfgang M. M. <wol...@us...> - 2005-07-30 17:22:18
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/index In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4934/src/org/exist/storage/index Modified Files: RemoveValueLoggable.java StoreValueLoggable.java BFile.java Log Message: Fixed recovery: page needs to be read before page status can be checked. Index: StoreValueLoggable.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/index/StoreValueLoggable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StoreValueLoggable.java 26 Jul 2005 07:15:16 -0000 1.1 --- StoreValueLoggable.java 30 Jul 2005 17:22:06 -0000 1.2 *************** *** 95,99 **** public String dump() { ! return super.dump() + " - stored value on page " + page; } } --- 95,99 ---- public String dump() { ! return super.dump() + " - stored value with tid " + tid + " on page " + page; } } Index: BFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/index/BFile.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BFile.java 29 Jul 2005 18:54:33 -0000 1.4 --- BFile.java 30 Jul 2005 17:22:06 -0000 1.5 *************** *** 1086,1093 **** return; } ! if (page.getPageHeader().getStatus() == UNUSED) // page is obviously deleted later return; ! final byte[] data = page.read(); wp = new SinglePage(page, data, true); } --- 1086,1094 ---- return; } ! final byte[] data = page.read(); ! if (page.getPageHeader().getStatus() == UNUSED) { // page is obviously deleted later return; ! } wp = new SinglePage(page, data, true); } *************** *** 1143,1146 **** --- 1144,1148 ---- if (firstPage == null) { final Page page = getPage(loggable.pageNum); + page.read(); if (page.getPageHeader().getLsn() < 0 || requiresRedo(loggable, page)) { reuseDeleted(page); *************** *** 1350,1354 **** value.copyTo(page.data, len); } catch (RuntimeException e) { ! LOG.warn("Len: " + len + " ; value: " + value.size() + "; max: " + fileHeader.getWorkSize()); throw e; } --- 1352,1357 ---- value.copyTo(page.data, len); } catch (RuntimeException e) { ! LOG.warn("Storage error in page: " + page.getPageNum() + ! "; len: " + len + " ; value: " + value.size() + "; max: " + fileHeader.getWorkSize()); throw e; } *************** *** 1406,1409 **** --- 1409,1413 ---- if (dp == null) { final Page page = getPage(newPage); + byte[] data = page.read(); if (page.getPageHeader().getLsn() < 0 || requiresRedo(loggable, page)) { reuseDeleted(page); *************** *** 1412,1420 **** ph.setDataLength(0); ph.setDataLen(fileHeader.getWorkSize()); ! byte[] data = new byte[fileHeader.getWorkSize()]; ph.nextTID = 32; dp = new SinglePage(page, data, true); } else { - byte[] data = page.read(); dp = new SinglePage(page, data, true); } --- 1416,1423 ---- ph.setDataLength(0); ph.setDataLen(fileHeader.getWorkSize()); ! data = new byte[fileHeader.getWorkSize()]; ph.nextTID = 32; dp = new SinglePage(page, data, true); } else { dp = new SinglePage(page, data, true); } Index: RemoveValueLoggable.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/index/RemoveValueLoggable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RemoveValueLoggable.java 26 Jul 2005 07:15:16 -0000 1.1 --- RemoveValueLoggable.java 30 Jul 2005 17:22:06 -0000 1.2 *************** *** 88,92 **** public String dump() { ! return super.dump() + " - remove value from page " + page; } } --- 88,92 ---- public String dump() { ! return super.dump() + " - remove value with tid " + tid + " from page " + page; } } |