feat: use server-returned affected rows in BulkWriter#37
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Arrow Flight BulkWriter to consume server responses concurrently and return server-reported affected rows (parsed from FlightPutResult.ApplicationMetadata JSON), with fail-fast behavior when the server-side stream fails.
Changes:
- Start a background receive task when the DoPut stream is initialized, and drain responses concurrently.
- Parse and accumulate
affected_rowsfromFlightPutResult.ApplicationMetadataJSON and return that fromCompleteAsync. - Add unit tests for response draining (accumulation + RPC exception capture).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/GreptimeDB.Ingester/Client/BulkWriter.cs |
Adds background response draining, parses affected_rows from JSON metadata, and surfaces receive errors to WriteAsync/CompleteAsync. |
tests/GreptimeDB.Ingester.Tests/BulkWriterTests.cs |
Adds tests for the new drain/accumulation behavior and error capture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
114d911 to
64de75b
Compare
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
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.
BulkWriter now reads responses concurrently via a background async task, parses affected rows from
FlightPutResult.ApplicationMetadataJSON, and supports fail-fast in WriteAsync when the server returns an error.This aligns with the Go SDK fix for premature stream close that could cause write loss. GreptimeTeam/greptimedb-ingester-go#98