-
Notifications
You must be signed in to change notification settings - Fork 478
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
imlement issue #439 : Retry capability for write(final BatchPoints batchPoints) as well #495
Conversation
…hPoints batchPoints) as well
Codecov Report
@@ Coverage Diff @@
## master #495 +/- ##
===========================================
- Coverage 87.53% 87.44% -0.1%
- Complexity 365 367 +2
===========================================
Files 25 25
Lines 1500 1505 +5
Branches 167 167
===========================================
+ Hits 1313 1316 +3
- Misses 120 123 +3
+ Partials 67 66 -1
Continue to review full report at Codecov.
|
I thought the whole purpose of offering |
I second @fmachado this is kinda over engineered. If someone wants retry capabilities, only batching makes sense, so adding this kind of functionality is not worth the additional complexity. |
I believe this PR will also increase the reliability/resilience of influxdb-java retry for BTW, there not much additional complexity, much of the change is just code refactoring |
But isn't that the point of having a seperate |
It's just easy to limit the retry buffer (used inside
Yes, however it's also just easy to turn off the retry via Moreover, I believe there are also use cases where user will expect writing of BatchPoints can be retried, especially when he see the batching can be backed off and retried |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find an issue reported that would justify this implementation. Personally I would never use this implementation with batch enabled because, as I said before, for me the whole idea of using this method is to be able to write multiple points having on my side the control over the batching mechanism.
Anyway, this implementation caused some not nice collateral effects on the project. If you could find a better way to solve the issues I mentioned then I'm OK with this PR.
} | ||
} | ||
|
||
void writeNoRetry(final BatchPoints batchPoints) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand you don't want to expose this method but maybe we should review if this behavior is really necessary. I have some general points here (I hope I'm not being too picky):
- Because of this method you will be forced to declare the implementation (
InfluxDBImpl
) instead of the interface (InfluxDB
) as you did on a few classes like OneShotBatchWriter line 12 for example. IMHO we have to chose if we are going to follow the API contract 100% of the time or just abandon it because this hybrid approach is not a good standard; - The method name may cause some confusion. Check how the call stack when you use
RetryCapableBatchWriter
:
InfluxDBImpl.write(...)
RetryCapableBatchWriter.write(...)
RetryCapableBatchWriter.tryToWrite(...)
InfluxDBImpl.writeNoRetry(...)
Unfortunately I don't have a better naming recommendation for it right now. I just want to point that you are calling a method writeNoRetry
from a class that was supposed to be able to retry failed writes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I will open a new PR to extend InfluxDB interface, (one specific method for this retry purpose)
@lxhoan should we close this pr ? |
closed since PR #503 is the final choice |
With this PR, if InfluxDBImpl is batch enabled, then write(final BatchPoints batchPoints) will use batch writer to write BatchPoints
this PR to make the consistency between writing single point and writing batch point, both must be retry capable as well