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

Handle LocalDatabase restart breaking bolt connections #9114

Merged
merged 1 commit into from
Apr 3, 2017

Conversation

mneedham
Copy link
Contributor

@mneedham mneedham commented Mar 29, 2017

This happens because TransactionIdStore doesn't get refreshed after a store copy.

  • Introduce CANCELLED state so that polling process doesn't get restarted unless we explicitly want to restart it
  • Pass around a supplier of TransactionIdStore and resolve it in TransactionIdTracker
  • Bumped drivers to 1.2

@mneedham mneedham requested a review from lutovich March 29, 2017 10:45
@mneedham mneedham changed the title Handle LocalDatabase restart breaking bolt connections due to Transac… Handle LocalDatabase restart breaking bolt connections Mar 29, 2017
Copy link
Contributor

@lutovich lutovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mneedham changes look good to me. Made two minor comments. PR build failed with checkstyle violation: TransactionIdTrackerTest.java:67: Line has trailing spaces.

I'll look at failing driver tests now.

@@ -64,7 +65,7 @@
TransactionStateMachineSPI( GraphDatabaseAPI db,
ThreadToStatementContextBridge txBridge,
QueryExecutionEngine queryExecutionEngine,
TransactionIdStore transactionIdStoreSupplier,
Supplier<TransactionIdStore> transactionIdStoreSupplier,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we maybe remove this param and take transactionIdStoreSupplier out of GraphDatabaseAPI db?
This is not very important but will reduce amount of constructor arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have changed this to get TransactionIdStore from db.getDependencyResolver()...

@@ -109,6 +110,6 @@ private boolean isReady( long oldestAcceptableTxId ) throws TransactionFailureEx
*/
public long newestEncounteredTxId()
{
return transactionIdStore.getLastClosedTransactionId();
return transactionIdStoreSupplier.get().getLastClosedTransactionId();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe extract transactionIdStoreSupplier.get() in a method with a comment saying why is it required.

@mneedham
Copy link
Contributor Author

@lutovich I've merged your branch into this one and then squashed everything. checkstyle locally seems happy so let's see if the build server agrees

…tionIdStore

not being refreshed

* Introduce CANCELLED state so that polling process doesn't get restarted unless we explicitly want to restart it
* Pass around a supplier of TransactionIdStore and resolve it in TransactionIdTracker
* Bumped drivers to 1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants