michaelklishin / quartz-mongodb

A MongoDB-based store for the Quartz scheduler. This fork strives to be as feature complete as possible. Originally by MuleSoft.
Other
248 stars 203 forks source link

Clustering support #106

Closed pwojnowski closed 8 years ago

pwojnowski commented 8 years ago

Most commits just refactor code to smaller, understandable and testable, parts.

The most important changes are around acquiring triggers and LocksDao.

Fixes #66

nikos commented 8 years ago

Thanks a lot @pwojnowski for working and sharing your clustering improvements, hopefully they will be part of Michael's master branch soon :-)

msimerson commented 8 years ago

Nice work. Thanks @pwojnowski. I was looking at opening a PR to update to mongo 3.2 driver, but I'd like to see this land first.

connollyst commented 8 years ago

Would love to see this branch merged. Any way I can help?

michaelklishin commented 8 years ago

@connollyst there are merge conflicts with master. The need to be resolved.

pwojnowski commented 8 years ago

@michaelklishin I already incorporated the commits from other PR and everything builds fine. I don't know why GH shows that my branch has conflicts.

I'm still working on Failover, because it doesn't work for all possible cases. But if this should ever be merged then IMHO it would be better do so now to allow other people to contribute without creating conflicting PRs all the time - at this momemnt it is inevitable, because the code structure has changed a lot.

Another thing is IMHO it would be better to change tests from Clojure to something where creating mocks is much simpler (e.g. Spock Framewok). I like Clojure, but writing Clojure tests for Java code is often painful and TDD is basically impossible. I can rewrite tests to Spock if you agree to do so.

pwojnowski commented 8 years ago

@michaelklishin ok, I've corrected failover part. Now nodes can recover own and other nodes' triggers.

I'm not sure about two things:

  1. Currently, when a node cannot check-in on time it shuts down the JVM, but it would be better to just close Quartz Scheduler. It would be best to turn QS into standby mode, but it's not implemented.
  2. IMHO WriteConcern should not be JOURNALED, because it doesn't wait for replicas to get wrote data. It would be better to set something like MAJORITY+JOURNALED.

BTW if you don't plan to merge this PR just say it and I'll just create a fork to not bother you. Thanks!

michaelklishin commented 8 years ago

@pwojnowski I am perfectly fine with switching to MAJORITY+JOURNALED. As for stand by mode, if you feel it's worth using, then please implement support for it and lets use that.

I am interested in merging this. Thank you for your time.

michaelklishin commented 8 years ago

@pwojnowski let me know when this is ready for one last review and merging. Thank you.

pwojnowski commented 8 years ago

@michaelklishin now it is ready to be merged. Today I just added docs and removed one deprecation.

In case of other changes I will create another PR - for example to other issues.

michaelklishin commented 8 years ago

@pwojnowski thank you! Please update change log and credit yourself. It'd be great to have this documented well :)