Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using TimestampSkipping iterator in RollbackCheckIterator #962

Closed
wants to merge 4 commits into from

Conversation

llvieira
Copy link
Contributor

@llvieira llvieira commented Oct 26, 2017

Closes #949. Using TimestampSkipping iterator on the RollbackCheckIterator to jump to later timestamps.

@keith-turner
Copy link
Contributor

keith-turner commented Oct 26, 2017

@llvieira there is a bit more that needs to be done for this issue. In the while loop in the seek method, need to use the timestampskipping iterator to jump ahead. When the colType is TX_DONE, can do the following :

     if (colType == ColumnConstants.TX_DONE_PREFIX) {
       # jump to WRITE skipping all TX_DONE
       source.skipToPrefix(curCol, ColumnConstants.WRITE_PREFIX);
     } else if (colType == ColumnConstants.WRITE_PREFIX) {

For WRITE_PREFIX we can jump ahead to DEL_LOCK_PREFIX when lockTime > timePtr. For DEL_LOCK_PREFIX we can jump to LOCK_PREFIX when lockTime > ts.

The background on this is that the column prefixs are in sorted order (descending sort of signed long and the prefix is the 1st three bits). There could be lots of column prefixes and once we determine that nothing else in the current prefix is useful then we can seek to the next possible prefix. This has the potential to seek over a lot of prefixes. The code is currently doing a linear scan of all column prefixes.

@llvieira
Copy link
Contributor Author

llvieira commented Oct 27, 2017

@keith-turner thanks for the help and for the clarification. I made the required changes, can you see if it is ok?


Now I saw that the changes caused some issues, but before I submit the commit, I ran the tests locally and all worked fine I guess. I still don't know why this happened.

@keith-turner
Copy link
Contributor

@llvieira I figured out the problem. Calling source.skipToPrefix() advanced the time skippin iterator to where it needs to be, however a later call to source.next() moves it one past where it needs to be.

@llvieira
Copy link
Contributor Author

llvieira commented Oct 27, 2017

Oh yeah, I'll fix it.

@llvieira
Copy link
Contributor Author

llvieira commented Oct 28, 2017

Now I'm having a non-deterministic behavior when I run the tests, because locally all tests run successfully but in the tarvis an error is raised.

Tarvis:

Running org.apache.fluo.integration.impl.TransactorIT
2017-10-28 00:52:28,350 [imps.CuratorFrameworkImpl] ERROR: Background exception was not retry-able or retry gave up
java.lang.IllegalStateException: Client is not started
	at com.google.common.base.Preconditions.checkState(Preconditions.java:149)
	at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:113)
	at org.apache.curator.framework.imps.CuratorFrameworkImpl.performBackgroundOperation(CuratorFrameworkImpl.java:806)
	at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:490)
	at org.apache.curator.framework.imps.CreateBuilderImpl.pathInBackground(CreateBuilderImpl.java:663)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:439)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44)
	at org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode.createNode(PersistentEphemeralNode.java:340)
	at org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode.access$000(PersistentEphemeralNode.java:53)
	at org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode$1.process(PersistentEphemeralNode.java:70)
	at org.apache.curator.framework.imps.NamespaceWatcher.process(NamespaceWatcher.java:61)
	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:530)
	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:505)
2017-10-28 00:52:28,352 [imps.CuratorFrameworkImpl] ERROR: Background exception was not retry-able or retry gave up
java.lang.IllegalStateException: Client is not started
	at com.google.common.base.Preconditions.checkState(Preconditions.java:149)
	at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:113)
	at org.apache.curator.framework.imps.CuratorFrameworkImpl.performBackgroundOperation(CuratorFrameworkImpl.java:806)
	at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(CuratorFrameworkImpl.java:490)
	at org.apache.curator.framework.imps.CreateBuilderImpl.pathInBackground(CreateBuilderImpl.java:663)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:439)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44)
	at org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode.createNode(PersistentEphemeralNode.java:340)
	at org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode.access$000(PersistentEphemeralNode.java:53)
	at org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode$1.process(PersistentEphemeralNode.java:70)
	at org.apache.curator.framework.imps.NamespaceWatcher.process(NamespaceWatcher.java:61)
	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:530)
	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:505)
Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 29.869 sec <<< FAILURE! - in org.apache.fluo.integration.impl.TransactorIT
testTransactorAndCache(org.apache.fluo.integration.impl.TransactorIT)  Time elapsed: 5.66 sec  <<< FAILURE!
java.lang.AssertionError
	at org.apache.fluo.integration.impl.TransactorIT.testTransactorAndCache(TransactorIT.java:64)

Locally:

[INFO] Reactor Summary:
[INFO] 
[INFO] Apache Fluo Project ................................ SUCCESS [ 14.261 s]
[INFO] Apache Fluo API .................................... SUCCESS [ 21.973 s]
[INFO] Apache Fluo Accumulo Extensions .................... SUCCESS [ 17.406 s]
[INFO] Apache Fluo Core ................................... SUCCESS [ 27.737 s]
[INFO] Apache Fluo Cluster ................................ SUCCESS [ 11.530 s]
[INFO] Apache Fluo Command ................................ SUCCESS [  7.784 s]
[INFO] Apache Fluo Mini ................................... SUCCESS [  5.707 s]
[INFO] Apache Fluo Integration ............................ SUCCESS [18:11 min]
[INFO] Apache Fluo MapReduce Utilities .................... SUCCESS [ 48.874 s]
[INFO] Apache Fluo Distribution ........................... SUCCESS [ 23.514 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21:10 min
[INFO] Finished at: 2017-10-27T22:19:20-03:00
[INFO] Final Memory: 70M/428M
[INFO] ------------------------------------------------------------------------

Any ideas on what's happening, @keith-turner?

@keith-turner
Copy link
Contributor

keith-turner commented Oct 28, 2017 via email

@keith-turner
Copy link
Contributor

@llvieira the change look good. I merged and squashed in 202fe08. Thanks again!

@llvieira llvieira deleted the iterator#949 branch October 30, 2017 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants