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

Astyanax retry policy is missing as configuration option #32

Open
nadenf opened this issue Dec 6, 2012 · 3 comments
Open

Astyanax retry policy is missing as configuration option #32

nadenf opened this issue Dec 6, 2012 · 3 comments

Comments

@nadenf
Copy link
Contributor

nadenf commented Dec 6, 2012

To make PlayOrm more robust it would be very useful to add configuration for Astyanax's retry policy:

CassandraSession.java:

ColumnList<String> result = keyspace.prepareQuery(CF_STANDARD1)
    .withRetryPolicy(new ExponentialBackoff(250, 5))
    .getKey(rowKey)
    .execute().getResult();

So for example in application.conf we could have:

nosql.cassandra.retryPolicy=none, ntimes, exponential, constant, boundedexponential

nosql.cassandra.retryPolicy.ntimes.maxAttempts=5

nosql.cassandra.retryPolicy.constant.sleepTime=250
nosql.cassandra.retryPolicy.constant.maxAttempts=5

nosql.cassandra.retryPolicy.exponential.baseSleepTime=250
nosql.cassandra.retryPolicy.exponential.maxAttempts=5

nosql.cassandra.retryPolicy.boundedexponential.baseSleepTime=250
nosql.cassandra.retryPolicy.boundedexponential.maxSleepTime=5000
nosql.cassandra.retryPolicy.boundedexponential.maxAttempts=5

Alternatively we can make it simpler in the config and then decide which mode to use in the code:

nosql.cassandra.retry=true
nosql.cassandra.retry.maxAttempts=10
nosql.cassandra.retry.useExponentialSleepTime=true
nosql.cassandra.retry.sleepTimeBetweenAttempts=250
nosql.cassandra.retry.maxSleepTimeBetweenAttempts=5000

See here:
https://github.com/Netflix/astyanax/wiki/Customizing-calls

@deanhiller
Copy link
Owner

We actually allow you to inject the astyanax client itself ;) so you can do what you want today ;) . That said, I am going to modify this requirement to say that for our default astyanax client that we create for you(when you don't inject your own), This requirement is now we want to change BootstrapImpl.createBestConfig such that we use reflection on the method names so they can chain the above methods and we automatically pass it through from the properties they give us to calling the correct methods. In this fashion, whatever properties astyanax adds would be automatically accessible so as we upgrade, the new functions are exposed without any work on our part.

@deanhiller
Copy link
Owner

NOTE: Check on issue #33 and make sure that works before this ticket is closed. Both 33 and 32 is really the same work that needs to be done but just perhaps different testing.

@hsn10
Copy link
Contributor

hsn10 commented Jun 28, 2013

Default astyanax policy needs to be changed. Currently if i am using playframework plugin and restart cassandra then all previously opened connection will fail and present error page to user.

Astyanax has ExecuteWithFailover and RetryPolicy. It should be configured by default to retry connection before throwing error.

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