From: <tho...@us...> - 2010-10-17 13:10:57
|
Revision: 3804 http://bigdata.svn.sourceforge.net/bigdata/?rev=3804&view=rev Author: thompsonbry Date: 2010-10-17 13:10:51 +0000 (Sun, 17 Oct 2010) Log Message: ----------- Modified the transaction service to permit assignment of a read-only transaction identifier when given a timestamp which is GT the last commit time on the database but LT the last timestamp actually assigned by the transaction service using nextTimestamp(). This permits the use of valid timestamps beyond the last commit time on the database when requesting a read-only transaction. This also handles the edge case when a transaction is requested for a timestamp which is actually a read-only transaction reading from the last commit time on the database. This case was observed using the SAIL with the NanoSparqlServer. This commit provides a workaround. An issue has been filed to look into this further. See https://sourceforge.net/apps/trac/bigdata/ticket/187. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/AbstractTransactionService.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/AbstractTransactionService.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/AbstractTransactionService.java 2010-10-17 11:09:45 UTC (rev 3803) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/AbstractTransactionService.java 2010-10-17 13:10:51 UTC (rev 3804) @@ -618,9 +618,11 @@ */ synchronized private final long _nextTimestamp() { - return MillisecondTimestampFactory.nextMillis(); + return lastTimestamp = MillisecondTimestampFactory.nextMillis(); } + /** The last timestamp issued. */ + private volatile long lastTimestamp; /** * Note: There is an upper bound of one read-write transaction that may be @@ -1232,16 +1234,18 @@ final long lastCommitTime = getLastCommitTime(); - if (timestamp > lastCommitTime) { +// if (timestamp > lastCommitTime) { + if (timestamp > lastTimestamp) { /* * You can't request a historical read for a timestamp which has not * yet been issued by this service! */ - throw new IllegalStateException( - "Timestamp is in the future: timestamp=" + timestamp - + ", lastCommitTime=" + lastCommitTime); + throw new IllegalStateException( + "Timestamp is in the future: timestamp=" + timestamp + + ", lastCommitTime=" + lastCommitTime + + ", lastTimestamp=" + lastTimestamp); } else if (timestamp == lastCommitTime) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |