Add support for HA and multishard functionality in import APIs#9406
Merged
mangalaman93 merged 2 commits intomainfrom Jun 20, 2025
Merged
Add support for HA and multishard functionality in import APIs#9406mangalaman93 merged 2 commits intomainfrom
mangalaman93 merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for high availability and multishard functionality in the import APIs by introducing a new streaming mechanism for propagating partition directory (P dir) updates across nodes. Key changes include:
- Adding new stream processing functions and a helper for managing ongoing P dir tasks.
- Introducing a new RPC (ReqPDirStream) and related message and client/server implementations.
- Updating tests and client code to leverage the new streaming workflow.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| worker/import.go | Adds streamProcessorSender support, a new stream task check, and updates the acknowledgment flow for stream processing. |
| worker/draft.go | Introduces a new opStreamPDir constant and string conversion for task identification. |
| protos/pb/pb_grpc.pb.go | Implements the new ReqPDirStream RPC handler methods and client stream handling. |
| protos/pb.proto | Defines the new ReqPDirStreamRequest message and RPC in the Worker service. |
| edgraph/server.go | Removes legacy drain mode invocation in favor of the new stream-based approach. |
| dgraph/cmd/dgraphimport/import_test.go | Updates test parameters and introduces a longer fixed sleep period post-import. |
| dgraph/cmd/dgraphimport/import_client.go | Refactors stream data logic to use the new RunBadgerStream method from the worker package. |
Comments suppressed due to low confidence (1)
worker/import.go:319
- The removal of sending the acknowledgment using stream.SendAndClose in this function appears to be intentional given the updated flow in InStream. Please verify that the ACK signal is being sent exactly once during stream processing to avoid protocol inconsistencies.
return nil
2572f94 to
dc05732
Compare
|
Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information. |
ada9899 to
eddd33c
Compare
mangalaman93
requested changes
May 29, 2025
mangalaman93
requested changes
May 30, 2025
c650635 to
2bf5aa4
Compare
mangalaman93
requested changes
Jun 16, 2025
2bf5aa4 to
f1037a3
Compare
mangalaman93
requested changes
Jun 17, 2025
f1037a3 to
bb432d3
Compare
mangalaman93
approved these changes
Jun 20, 2025
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.
Description
Please explain the changes you made here.
Checklist
CHANGELOG.mdfile describing and linking tothis PR
docs repo staged and linked here
Instructions
syntax, leading with
fix:,feat:,chore:,ci:, etc.link to the bug.
[x]syntax.back and check the box later.
Instructionsline and everything below it, to indicate you have read and arefollowing these instructions. 🙂
Thank you for your contribution to Dgraph!