-
Notifications
You must be signed in to change notification settings - Fork 1.6k
make dgraph import work across the internet #9456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
28c9712
Make dgraph import work over the internet
mangalaman93 b63bf0d
increase timeout
shivaji-kharse 6457040
fix import
shivaji-kharse f6d02c0
regenerate protos
shivaji-kharse ad76453
import new dgo
shivaji-kharse 18f07aa
Fix issues
mangalaman93 45ca357
import dgo preview7
mangalaman93 9f57ac6
increase timeout
shivaji-kharse 11e8379
remove unwanted print statements
shivaji-kharse e57ca16
fix import
shivaji-kharse aa79726
fix single group import
shivaji-kharse 7732d9a
fix pub sub
shivaji-kharse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build integration | ||
//go:build integration2 | ||
|
||
/* | ||
* SPDX-FileCopyrightText: © Hypermode Inc. <[email protected]> | ||
|
@@ -79,7 +79,8 @@ func TestDrainModeAfterStartSnapshotStream(t *testing.T) { | |
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
conf := dgraphtest.NewClusterConfig().WithNumAlphas(tt.numAlphas).WithNumZeros(tt.numZeros).WithReplicas(tt.replicas) | ||
conf := dgraphtest.NewClusterConfig().WithNumAlphas(tt.numAlphas). | ||
WithNumZeros(tt.numZeros).WithReplicas(tt.replicas) | ||
c, err := dgraphtest.NewLocalCluster(conf) | ||
require.NoError(t, err) | ||
defer func() { c.Cleanup(t.Failed()) }() | ||
|
@@ -284,15 +285,14 @@ func runImportTest(t *testing.T, tt testcase) { | |
require.ErrorContains(t, err, tt.err) | ||
return | ||
} | ||
|
||
require.NoError(t, Import(context.Background(), connectionString, outDir)) | ||
|
||
for group, alphas := range alphaGroups { | ||
for i := 0; i < tt.downAlphas; i++ { | ||
alphaID := alphas[i] | ||
t.Logf("Starting alpha %v from group %v", alphaID, group) | ||
require.NoError(t, targetCluster.StartAlpha(alphaID)) | ||
require.NoError(t, waitForAlphaReady(t, targetCluster, alphaID, 30*time.Second)) | ||
require.NoError(t, waitForAlphaReady(t, targetCluster, alphaID, 60*time.Second)) | ||
} | ||
} | ||
|
||
|
@@ -306,7 +306,7 @@ func runImportTest(t *testing.T, tt testcase) { | |
require.NoError(t, err) | ||
defer cleanup() | ||
|
||
require.NoError(t, validateClientConnection(t, gc, 10*time.Second)) | ||
require.NoError(t, validateClientConnection(t, gc, 30*time.Second)) | ||
verifyImportResults(t, gc, tt.downAlphas) | ||
} | ||
} | ||
|
@@ -347,7 +347,9 @@ func setupBulkCluster(t *testing.T, numAlphas int, encrypted bool) (*dgraphtest. | |
} | ||
|
||
// setupTargetCluster creates and starts a cluster that will receive the imported data | ||
func setupTargetCluster(t *testing.T, numAlphas, replicasFactor int) (*dgraphtest.LocalCluster, *dgraphapi.GrpcClient, func()) { | ||
func setupTargetCluster(t *testing.T, numAlphas, replicasFactor int) ( | ||
*dgraphtest.LocalCluster, *dgraphapi.GrpcClient, func()) { | ||
|
||
conf := dgraphtest.NewClusterConfig(). | ||
WithNumAlphas(numAlphas). | ||
WithNumZeros(3). | ||
|
@@ -366,7 +368,7 @@ func setupTargetCluster(t *testing.T, numAlphas, replicasFactor int) (*dgraphtes | |
|
||
// verifyImportResults validates the result of an import operation with retry logic | ||
func verifyImportResults(t *testing.T, gc *dgraphapi.GrpcClient, downAlphas int) { | ||
maxRetries := 1 | ||
maxRetries := 5 | ||
if downAlphas > 0 { | ||
maxRetries = 10 | ||
} | ||
|
@@ -547,7 +549,7 @@ func retryHealthCheck(t *testing.T, cluster *dgraphtest.LocalCluster, timeout ti | |
// validateClientConnection ensures the client connection is working before use | ||
func validateClientConnection(t *testing.T, gc *dgraphapi.GrpcClient, timeout time.Duration) error { | ||
deadline := time.Now().Add(timeout) | ||
retryDelay := 200 * time.Millisecond | ||
retryDelay := 1 * time.Second | ||
|
||
for time.Now().Before(deadline) { | ||
if _, err := gc.Query("schema{}"); err != nil { | ||
|
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
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
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.