Skip to content

Commit

Permalink
Revert "feat(query): add feature flag list-in-normalize (#8845)"
Browse files Browse the repository at this point in the history
This reverts commit d3ec3b9.
                and 6ed8b5c.
  • Loading branch information
mangalaman93 committed Jun 14, 2023
1 parent 2787cfc commit 506e9a3
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 156 deletions.
11 changes: 0 additions & 11 deletions dgraph/cmd/alpha/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,6 @@ they form a Raft group and provide synchronous replication.
Flag("size",
"The audit log max size in MB after which it will be rolled over.").
String())

flag.String("feature-flags", worker.FeatureFlagsDefaults, z.NewSuperFlagHelp(worker.FeatureFlagsDefaults).
Head("Feature flags to enable various experimental features").
Flag("list-in-normalize", "enables returning a list when there are multiple fields with same alias, "+
"see here for more details https://github.com/dgraph-io/dgraph/pull/7639").
String())
}

func setupCustomTokenizers() {
Expand Down Expand Up @@ -743,11 +737,6 @@ func run() {
}
edgraph.Init()

// feature flags
featureFlagsConf := z.NewSuperFlag(Alpha.Conf.GetString("feature-flags")).MergeAndCheckDefault(
worker.FeatureFlagsDefaults)
x.Config.ListInNormalize = featureFlagsConf.GetBool("list-in-normalize")

x.PrintVersion()
glog.Infof("x.Config: %+v", x.Config)
glog.Infof("x.WorkerConfig: %+v", x.WorkerConfig)
Expand Down
8 changes: 1 addition & 7 deletions dgraphtest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ type ClusterConfig struct {
refillInterval time.Duration
uidLease int
// exposed port offset for grpc/http port for both alpha/zero
portOffset int
featureFlags []string
portOffset int
}

func NewClusterConfig() ClusterConfig {
Expand Down Expand Up @@ -164,8 +163,3 @@ func (cc ClusterConfig) WithExposedPortOffset(offset uint64) ClusterConfig {
cc.portOffset = int(offset)
return cc
}

func (cc ClusterConfig) WithListInNormalize(toggle bool) ClusterConfig {
cc.featureFlags = append(cc.featureFlags, fmt.Sprintf("list-in-normalize=%v", toggle))
return cc
}
5 changes: 0 additions & 5 deletions dgraphtest/dgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"os"
"path/filepath"
"strconv"
"strings"
"time"

"github.com/docker/docker/api/types/mount"
Expand Down Expand Up @@ -234,10 +233,6 @@ func (a *alpha) cmd(c *LocalCluster) []string {
}
acmd = append(acmd, zeroAddrsArg)

if len(c.conf.featureFlags) > 0 {
acmd = append(acmd, fmt.Sprintf("--feature-flags=%v", strings.Join(c.conf.featureFlags, ";")))
}

return acmd
}

Expand Down
122 changes: 0 additions & 122 deletions query/normalize_feature_flag_test.go

This file was deleted.

9 changes: 3 additions & 6 deletions query/outputnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -978,12 +978,9 @@ func (enc *encoder) normalize(fj fastJsonNode) ([]fastJsonNode, error) {
}

for i, slice := range parentSlice {
if x.Config.ListInNormalize {
// sort the fastJson list. This will ensure that nodes
// with same attribute name comes together in response
enc.MergeSort(&parentSlice[i])
}

// sort the fastJson list
// This will ensure that nodes with same attribute name comes together in response
enc.MergeSort(&parentSlice[i])
// From every list we need to remove node with attribute "uid".
var prev, cur fastJsonNode
cur = slice
Expand Down
3 changes: 1 addition & 2 deletions worker/server_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ const (
ZeroLimitsDefaults = `uid-lease=0; refill-interval=30s; disable-admin-http=false;`
GraphQLDefaults = `introspection=true; debug=false; extensions=true; poll-interval=1s; ` +
`lambda-url=;`
CacheDefaults = `size-mb=1024; percentage=0,65,35;`
FeatureFlagsDefaults = `list-in-normalize=true`
CacheDefaults = `size-mb=1024; percentage=0,65,35;`
)

// ServerState holds the state of the Dgraph server.
Expand Down
3 changes: 0 additions & 3 deletions x/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ type Options struct {
// poll-interval duration - The polling interval for graphql subscription.
GraphQL *z.SuperFlag
GraphQLDebug bool

// feature flags
ListInNormalize bool
}

// Config stores the global instance of this package's options.
Expand Down

0 comments on commit 506e9a3

Please sign in to comment.