feat(write): add no_sync option to the write command#26703
Conversation
The influxdb3 write command was lacking a way to set the no_sync option which tells the server to acknowledge the write request before it is durable. This changeset provides a cli flag to configure that option and wire it into the client call. It adds a test that makes use of the new setter. It relies on other tests that the api works as it should. A few typos and a minor update the precision flag, to include the `auto` option, were also included. This will make using the write command for importing line protocol more flexible. * closes #26702
praveen-influx
left a comment
There was a problem hiding this comment.
Changes look good 👍
I've left a minor comment around exposing auto, if you think it might be redundant too then it'd be good to address it before merging.
| line_protocol: Option<Vec<String>>, | ||
|
|
||
| /// Specify a supported precision (eg: ns, us, ms, s). | ||
| /// Specify a supported precision (eg: auto, ns, us, ms, s). |
There was a problem hiding this comment.
I believe auto is left out as server sets it to Precision::Auto when it's not passed through, so users can leave out this argument when calling influxdb3 write.
influxdb/influxdb3_server/src/http.rs
Line 636 in 8dcb92c
I don't think there's any harm in exposing it, but setting explicitly to auto on client might be redundant.
There was a problem hiding this comment.
I think including it in the help is useful so users know it is an option; they might like to be explicit or future proof against changes to the default; but i don't feel strongly about it and its a minor thing. I'm inclined to leave it as in the pr.
The influxdb3 write command was lacking a way to set the no_sync option which tells the server to acknowledge the write request before it is durable. This changeset provides a cli flag to configure that option and wire it into the client call. It adds a test that makes use of the new setter. It relies on other tests that the api works as it should.
A few typos and a minor update the precision flag, to include the
autooption, were also included.This will make using the write command for importing line protocol more flexible.
It can be exercised like so
influxdb3 write --no-sync --database foobar "m1 f=1"writecommand #26702