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

read-log doesn't end when using tx ids #26

Open
jeremyheiler opened this issue Mar 24, 2017 · 9 comments
Open

read-log doesn't end when using tx ids #26

jeremyheiler opened this issue Mar 24, 2017 · 9 comments

Comments

@jeremyheiler
Copy link
Contributor

If you use tx ids for start and end with read-log, it never ends since it compares the end-tx with t, which is (effectively) always smaller.

https://github.com/onyx-platform/onyx-datomic/blob/0.10.x/src/onyx/plugin/datomic.clj#L200

This leads me to wonder if tx ids are supported? I assumed so based on the name of the keys :datomic/log-start-tx and :datomic/log-end-tx. And both t and tx ids are supported by datomic.api/tx-range.

I'd be happy to provide a patch either way.

@MichaelDrogalis
Copy link
Contributor

cc @lbradstreet

@lbradstreet
Copy link
Member

lbradstreet commented Mar 25, 2017 via email

@lbradstreet
Copy link
Member

Hi @jeremyheiler, we're still happy to put this in onyx-datomic if you've made any progress. Thanks!

@jeremyheiler
Copy link
Contributor Author

jeremyheiler commented Apr 4, 2017

I'm working on it now. I had to take a break from this, but now I'm back and it's directly blocking me.

@lbradstreet
Copy link
Member

lbradstreet commented Apr 4, 2017 via email

@jeremyheiler
Copy link
Contributor Author

No worries! :-)

@jeremyheiler
Copy link
Contributor Author

Thinking about it a little more, I'm not sure the best way to handle tx ids. My thought would be to normalize them to t values so comparison operations can be done. But is there a good predicate for tx ids? Perhaps byte length?

@lbradstreet
Copy link
Member

lbradstreet commented Apr 5, 2017

Normalizing to t values seems reasonable.

Maybe we could make a breaking change and deprecate:
:datomic/log-start-tx and :daotmic/log-end-tx.

and then create two sets of task parameters
:datomic/log-start-t, :datomic/log-end-t
and
:datomic/log-start-txid, :datomic/log-end-txid

Then we could also change the behaviour of log-end-t to not be exclusive on the end t?

Alternatively, the task-map could take a param :datomic/log-tx-type :txid or :datomic/log-tx-type :t which switches between them.

@jeremyheiler
Copy link
Contributor Author

I don't think I have a preference. In the first solution, someone could accidentally mix :datomic/log-start-t with :datomic/log-end-txid. Is there a place to validate that? Although, it'd be easy to normalize the one txid to a t, so that might be OK. Then again, with the second solution, someone could say :txid and provide t values. Bleh..

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

No branches or pull requests

3 participants