-
Notifications
You must be signed in to change notification settings - Fork 129
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
WriteAPI - WriteOptions #145
Comments
Hi @csballa, thanks for using our client. You could configure batching by WriteOptions writeOptions = WriteOptions.builder()
.batchSize(5000)
.flushInterval(1000)
.bufferLimit(10000)
.jitterInterval(1000)
.retryInterval(5000)
.build();
WriteApi writeApi = client.getWriteApi(writeOptions);
We currently doesn't support DB/RP API (https://v2.docs.influxdata.com/v2.0/api/#tag/DBRPs), but it is a good suggestion to improve, so we will implemented it. Regards |
Hi @bednar, thanks for the quick response. As far as I can see the default write options are similar and having looked into the source code, I figured out that the issue here seems to be, that loosing connection or not having the configured DB/RP are not considered a retrieable error. Consequently the points are lost, in the batch and the write OP is not retried. I would suggest:
What do you think about the 1. point? Would it be possible to change the implementation so all unsuccesful write would be retried later on and the batch kept until it grows over its limit? |
Hi @csballa, We are working on improvement of retry strategy for the client. We will introduce new configuration options to be more user friendly:
Regards |
Hello @bednar, Thank you for the improvement! Thanks again! |
We will be retry all HTTP connection error + HTTP errors >= 429. |
Will you consider improving the error handling to provide the failed points in the ErrorEvents (Especially in WriteErrorEvent)? |
@csballa yes, we could do that in next PR after we will improve our retry strategy |
Hello @bednar, I have finally was able to try out the changes:
Scenario: Result:
Regards |
The interrupted exception should be fixed by #358. |
Hello,
I was trying to change a simple logger from the old java client to this one. I have expected a similar behaviour from the WriteOptions, as the previous client's batching mechanism.
Using the writeApi with the default WriteOptions doesn't seem to actually keep a batch, or retry writing if one attempt has failed.
It writes points to the given DB/retentionPolicy, but shuting down the influx server, or deleting the DB/RP would result in different logged, but swallowed errors (NotFoundException, InfluxException, ConnectException...). (I was trying to simulate connection loss/wrong configuration this way.)
After starting up the influx server, creating the DB/RP, it would continue to work, however points attempted to be written during the off time of the influxDB are lost.
As the errors are handled in the client, I don't see an easy solution to implement my own batching for points.
There is need for some extra config for the write options to take effect? As I have seen the default options are set even implicitly, but if I have to active them somehow I totally missed where or how:
(Not related: But I don't know where should I ask, but how can I test/query with this client for existence of a DB and/or RP?)
Thanks in advance for any fix/info!
Specifications:
The text was updated successfully, but these errors were encountered: