Skip to content

feat(write): add no_sync option to the write command#26703

Merged
philjb merged 2 commits intomainfrom
pjb/26702/add-no-sync-to-write
Aug 20, 2025
Merged

feat(write): add no_sync option to the write command#26703
philjb merged 2 commits intomainfrom
pjb/26702/add-no-sync-to-write

Conversation

@philjb
Copy link
Copy Markdown
Contributor

@philjb philjb commented Aug 19, 2025

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.

It can be exercised like so

influxdb3 write --no-sync --database foobar "m1 f=1"

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
@philjb philjb requested review from mgattozzi and waynr and removed request for mgattozzi August 19, 2025 22:25
Copy link
Copy Markdown
Contributor

@praveen-influx praveen-influx left a comment

Choose a reason for hiding this comment

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

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).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

params.precision.unwrap_or(Precision::Auto),

I don't think there's any harm in exposing it, but setting explicitly to auto on client might be redundant.

Copy link
Copy Markdown
Contributor Author

@philjb philjb Aug 20, 2025

Choose a reason for hiding this comment

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

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.

@philjb philjb merged commit 93ce09b into main Aug 20, 2025
12 checks passed
@philjb philjb deleted the pjb/26702/add-no-sync-to-write branch August 20, 2025 18:01
@philjb philjb added the v3 label Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support the "no_sync" option from the influxdb3 write command

2 participants