From c245651f33c5b010155198094c08b8e323aa04bd Mon Sep 17 00:00:00 2001 From: Shiva Date: Thu, 4 Dec 2025 18:51:46 +0530 Subject: [PATCH 1/4] Unskip previously skipped tests --- dgraph/cmd/dgraphimport/import_test.go | 5 +++-- dgraphtest/load.go | 4 ++-- dgraphtest/local_cluster.go | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dgraph/cmd/dgraphimport/import_test.go b/dgraph/cmd/dgraphimport/import_test.go index bd762ede6b1..bf4e6a718a2 100644 --- a/dgraph/cmd/dgraphimport/import_test.go +++ b/dgraph/cmd/dgraphimport/import_test.go @@ -75,7 +75,7 @@ func TestEmptyBulkOutDir(t *testing.T) { } func TestDrainModeAfterStartSnapshotStream(t *testing.T) { - t.Skip("Skipping... sometimes the query for schema succeeds even when the server is in draining mode") + // t.Skip("Skipping... sometimes the query for schema succeeds even when the server is in draining mode") tests := []struct { name string @@ -123,7 +123,7 @@ func TestDrainModeAfterStartSnapshotStream(t *testing.T) { } func TestImportApis(t *testing.T) { - t.Skip("Skipping import tests due to persistent flakiness with container networking and Raft leadership issues") + // t.Skip("Skipping import tests due to persistent flakiness with container networking and Raft leadership issues") tests := []testcase{ { @@ -412,6 +412,7 @@ func verifyImportResults(t *testing.T, gc *dgraphapi.GrpcClient, downAlphas int) // Get actual predicates actualPredicates := getPredicateMap(actualSchema) + hasAllPredicates := true // Check if all expected predicates are present for predName := range expectedPredicates { if _, exists := actualPredicates[predName]; !exists { diff --git a/dgraphtest/load.go b/dgraphtest/load.go index 4451a28f43e..a356f66612c 100644 --- a/dgraphtest/load.go +++ b/dgraphtest/load.go @@ -580,8 +580,8 @@ func downloadFile(fname, url string) error { cmd := exec.Command("wget", "-O", fname, url) cmd.Dir = datasetFilesPath - if out, err := cmd.CombinedOutput(); err != nil { - return fmt.Errorf("error downloading file %s: %s", fname, string(out)) + if _, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("error downloading file %s: %w", fname, err) } return nil } diff --git a/dgraphtest/local_cluster.go b/dgraphtest/local_cluster.go index c5fda79e375..6b48c8d4b2f 100644 --- a/dgraphtest/local_cluster.go +++ b/dgraphtest/local_cluster.go @@ -930,8 +930,7 @@ func (c *LocalCluster) Client() (*dgraphapi.GrpcClient, func(), error) { var conns []*grpc.ClientConn for _, aa := range c.alphas { if !aa.isRunning { - // QUESTIONS(shivaji): Should this be 'continue' instead of a break from the loop - break + continue } url, err := aa.alphaURL(c) if err != nil { From b219dd794e318a4ec136f111f38230a011f97bae Mon Sep 17 00:00:00 2001 From: Shiva Date: Mon, 8 Dec 2025 23:08:59 +0530 Subject: [PATCH 2/4] dont send group id when forwarding stream to alpha leader from proxy alpha --- worker/import.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/worker/import.go b/worker/import.go index 68a96b82f6b..b7b965e7272 100644 --- a/worker/import.go +++ b/worker/import.go @@ -298,7 +298,7 @@ func InStream(stream api.Dgraph_StreamExtSnapshotServer) error { return fmt.Errorf("failed to establish stream with leader: %v", err) } glog.Infof("[import] [forward %d -> %d] start", groups().Node.gid, groupId) - glog.Infof("[import] [forward %d -> %d] start", groups().Node.MyAddr, groups().Leader(groupId).Addr) + glog.Infof("[import] [forward %v -> %d] start", groups().Node.MyAddr, groups().Leader(groupId).Addr) glog.Infof("[import] sending forward true to leader of group [%v]", groupId) forwardReq := &api.StreamExtSnapshotRequest{Forward: true} @@ -313,12 +313,6 @@ func InStream(stream api.Dgraph_StreamExtSnapshotServer) error { func pipeTwoStream(in api.Dgraph_StreamExtSnapshotServer, out pb.Worker_StreamExtSnapshotClient, groupId uint32) error { currentGroup := groups().Node.gid ctx := in.Context() - if err := out.Send(&api.StreamExtSnapshotRequest{GroupId: groupId}); err != nil { - return fmt.Errorf("send groupId downstream(%d): %w", groupId, err) - } - if _, err := out.Recv(); err != nil { - return fmt.Errorf("ack groupId downstream(%d): %w", groupId, err) - } for { if err := ctx.Err(); err != nil { @@ -487,7 +481,7 @@ func streamInGroup(stream api.Dgraph_StreamExtSnapshotServer, forward bool) erro if forward { // We are not going to return any error from here because we care about the majority of nodes. // If the majority of nodes are able to receive the data, the remaining ones can catch up later. - glog.Infof("[import] Streaming external snapshot to [%v] from [%v] forward [%v]", member.Addr, node.MyAddr) + glog.Infof("[import] Streaming external snapshot to [%v] from [%v]", member.Addr, node.MyAddr) eg.Go(func() error { glog.Infof(`[import:forward] streaming external snapshot to [%v] from [%v]`, member.Addr, node.MyAddr) if member.AmDead { From 7cf5c2c2846015a5fd3e0422b7b3916e7447a8ab Mon Sep 17 00:00:00 2001 From: Shiva Date: Tue, 9 Dec 2025 14:09:39 +0530 Subject: [PATCH 3/4] resolve review comments --- dgraph/cmd/dgraphimport/import_test.go | 9 ++------- systest/backup/nfs-backup/Untitled | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) create mode 100644 systest/backup/nfs-backup/Untitled diff --git a/dgraph/cmd/dgraphimport/import_test.go b/dgraph/cmd/dgraphimport/import_test.go index bf4e6a718a2..b6925775a33 100644 --- a/dgraph/cmd/dgraphimport/import_test.go +++ b/dgraph/cmd/dgraphimport/import_test.go @@ -75,8 +75,6 @@ func TestEmptyBulkOutDir(t *testing.T) { } func TestDrainModeAfterStartSnapshotStream(t *testing.T) { - // t.Skip("Skipping... sometimes the query for schema succeeds even when the server is in draining mode") - tests := []struct { name string numAlphas int @@ -123,8 +121,6 @@ func TestDrainModeAfterStartSnapshotStream(t *testing.T) { } func TestImportApis(t *testing.T) { - // t.Skip("Skipping import tests due to persistent flakiness with container networking and Raft leadership issues") - tests := []testcase{ { name: "SingleGroupShutTwoAlphasPerGroup", @@ -391,12 +387,12 @@ func verifyImportResults(t *testing.T, gc *dgraphapi.GrpcClient, downAlphas int) } retryDelay := time.Second - hasAllPredicates := true // Get expected predicates first var expectedSchemaObj map[string]interface{} require.NoError(t, json.Unmarshal([]byte(expectedSchema), &expectedSchemaObj)) expectedPredicates := getPredicateMap(expectedSchemaObj) + var hasAllPredicates bool for i := 0; i < maxRetries; i++ { // Checking client connection again here because an import operation may be in progress on the rejoined alpha @@ -412,8 +408,7 @@ func verifyImportResults(t *testing.T, gc *dgraphapi.GrpcClient, downAlphas int) // Get actual predicates actualPredicates := getPredicateMap(actualSchema) - hasAllPredicates := true - // Check if all expected predicates are present + hasAllPredicates = true for predName := range expectedPredicates { if _, exists := actualPredicates[predName]; !exists { hasAllPredicates = false diff --git a/systest/backup/nfs-backup/Untitled b/systest/backup/nfs-backup/Untitled new file mode 100644 index 00000000000..c175a1bdb25 --- /dev/null +++ b/systest/backup/nfs-backup/Untitled @@ -0,0 +1 @@ +alpha1_backup_clust_ha \ No newline at end of file From 7da1837c8c0bd271500c1ffc6553169d69c24d0b Mon Sep 17 00:00:00 2001 From: Shiva Date: Mon, 5 Jan 2026 12:03:47 +0530 Subject: [PATCH 4/4] remove unwanted file --- systest/backup/nfs-backup/Untitled | 1 - 1 file changed, 1 deletion(-) delete mode 100644 systest/backup/nfs-backup/Untitled diff --git a/systest/backup/nfs-backup/Untitled b/systest/backup/nfs-backup/Untitled deleted file mode 100644 index c175a1bdb25..00000000000 --- a/systest/backup/nfs-backup/Untitled +++ /dev/null @@ -1 +0,0 @@ -alpha1_backup_clust_ha \ No newline at end of file