Conversation
There was a problem hiding this comment.
Pull request overview
Adds structured partial-write error support and updates write routing defaults to align with InfluxDB v3 behavior, while providing an opt-in v2 compatibility route.
Changes:
- Introduces
InfluxDBPartialWriteExceptionwith per-line error details and updates REST error parsing to surface it for v3 partial-write responses. - Changes default write endpoint to
/api/v3/write_lp, addsWriteOptions.AcceptPartial(defaulttrue) andWriteOptions.UseV2Apifor routing to/api/v2/write, plus config/env/connection-string support. - Updates unit/integration tests and documentation/changelog to reflect the new defaults and options.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents partial writes and v2 compatibility mode configuration. |
| Client/Internal/RestClient.cs | Switches error parsing to System.Text.Json and throws InfluxDBPartialWriteException when line errors are present. |
| Client/InfluxDBPartialWriteException.cs | Adds a new exception type carrying structured line-level errors. |
| Client/InfluxDBClient.cs | Routes writes to v3 by default; adds v2 routing option and query params for no_sync / accept_partial. |
| Client/Config/WriteOptions.cs | Adds AcceptPartial and UseV2Api plus validation for incompatible option combinations. |
| Client/Config/ClientConfig.cs | Adds connection string and env var parsing for new write options. |
| Client/Client.csproj | Adds System.Text.Json dependency for netstandard targets. |
| Client.Test/Internal/RestClientTest.cs | Expands tests to cover typed/untyped partial-write parsing and the new exception type. |
| Client.Test/InfluxDBClientWriteTest.cs | Updates expected write paths/query params for new v3 default and v2 compatibility mode. |
| Client.Test/InfluxDBClientHttpsTest.cs | Updates expected write endpoint to v3. |
| Client.Test/InfluxDBApiExceptionTest.cs | Updates expected write endpoint to v3. |
| Client.Test/Config/ClientConfigTest.cs | Adds coverage for new connection string/env config keys. |
| Client.Test.Integration/WriteTest.cs | Minor refactor for exception typing consistency. |
| CHANGELOG.md | Notes breaking default write routing + partial write support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Adds partial-write support with structured error details in
InfluxDBPartialWriteException, including per-lineLineNumber,ErrorMessage, andOriginalLineso callers can decide whether to drop/retry/fix specific lines in a batch.
This also aligns write routing with the rollout contract:
/api/v3/write_lpAcceptPartialdefaults totrue(server default behavior)accept_partial=falseis sent only when partial writes are explicitly disabledUseV2Apiroutes writes to/api/v2/writefor Clustered/v2-compatible backendsConfiguration surfaces now include:
AcceptPartial,UseV2ApiwriteAcceptPartial,writeUseV2ApiINFLUX_WRITE_ACCEPT_PARTIAL,INFLUX_WRITE_USE_V2_APIValidation:
UseV2Api=truewithNoSync=trueis rejected before request dispatch.See Partial writes in InfluxDB documentation.
Example:
Optional v2 compatibility mode:
Checklist