Skip to content
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

fix(proposals): Incremental proposal key for zero proposals (#8005) #8567

Merged
merged 24 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
62cef52
fix(proposals): Incremental proposal key for zero proposals (#8005)
all-seeing-code Sep 2, 2021
c697086
fix: fixing audit logs for websocket connections (#8048) (#8053) (#8627)
all-seeing-code Jan 24, 2023
84dbff5
fix(restore): consider the banned namespaces while bumping (#7839) (#…
mangalaman93 Jan 25, 2023
d5c5ffd
fix(sec): CVE-2022-41721 (#8633)
skrdgraph Jan 28, 2023
f92c578
fix(sec): CVE & OS Patching (#8634)
skrdgraph Jan 30, 2023
651d888
fix(backup): create directory before writing backup (#8638)
mangalaman93 Jan 30, 2023
3239462
temp commit
all-seeing-code Jan 31, 2023
752def6
chore(ci): update readme (#8632)
joshua-goldstein Jan 30, 2023
5148c95
fix(mutation): validate mutation before applying it (#8623)
mangalaman93 Jan 31, 2023
9aa7b9a
fix(groot): do not upsert groot for all namespaces on restart (#8561)
mangalaman93 Feb 1, 2023
e32548c
remove comments
all-seeing-code Feb 2, 2023
9a8a598
fix(tests): Added Backup/Restore test for NFS. (#8551)
shivaji-dgraph Feb 1, 2023
ff8fe2a
fix(restore): Set kv version to restoreTs for all keys (#7930) (#8563)
mangalaman93 Feb 2, 2023
65eb7a7
fix(probe): do not contend for lock in lazy load (#8037) (#8041) (#8566)
mangalaman93 Feb 2, 2023
2ae33e2
Add a test that after snapshot is applied, GraphQL schema is refreshe…
shivaji-dgraph Feb 2, 2023
b70d235
bug(core): Fixed infinite loop in CommitToDisk (#8614)
harshil-goel Feb 2, 2023
7443a10
Store namespace in predicate as a hex separated by a hyphen to preven…
harshil-goel Feb 3, 2023
1558efd
fix(proposalKey): Proposal key initialisation with correct byte order…
all-seeing-code Feb 6, 2023
cd759d7
wrap the functions
all-seeing-code Feb 7, 2023
6499c3f
fix(build): Update dockerfile to use cache busting and reduce image s…
all-seeing-code Feb 7, 2023
5573b56
fix test failures
all-seeing-code Feb 7, 2023
365cca5
fix imports
all-seeing-code Feb 7, 2023
3246cbd
chore(deps): update min go build version (#8423)
joshua-goldstein Feb 7, 2023
af9398f
Merge branch 'main' into anurag/cherry-pick-proposal-fix
all-seeing-code Feb 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(groot): do not upsert groot for all namespaces on restart (#8561)
Earlier, whenever the alpha starts(or restarts), we were upserting
guardian and groot for all the namespaces. This is not actually needed.
The change was made in the PR #7759 to fix a bulk loader edge case. This
PR fixes that by generating the required RDFs in the bulk loader itself.
Essentially, it inserts the ACL RDFs when force loading into non-Galaxy
namespace.

(cherry picked from commit 6730f10)

Co-authored-by: Naman Jain <naman@dgraph.io>
  • Loading branch information
2 people authored and all-seeing-code committed Feb 8, 2023
commit 9aa7b9a6297edd1eec4bbe8baf0a192d6e6ccce3
19 changes: 19 additions & 0 deletions dgraph/cmd/bulk/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/chunker"
"github.com/dgraph-io/dgraph/dql"
"github.com/dgraph-io/dgraph/ee/acl"
"github.com/dgraph-io/dgraph/posting"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/tok"
Expand All @@ -44,6 +45,10 @@ import (
"github.com/dgraph-io/ristretto/z"
)

var (
aclOnce sync.Once
)

type mapper struct {
*state
shards []shardState // shard is based on predicate
Expand Down Expand Up @@ -228,6 +233,20 @@ func (m *mapper) run(inputFormat chunker.InputFormat) {
}
}
}
aclOnce.Do(func() {
if m.opt.Namespace != math.MaxUint64 && m.opt.Namespace != x.GalaxyNamespace {
// Insert ACL related RDFs force uploading the data into non-galaxy namespace.
aclNquads := make([]*api.NQuad, 0)
aclNquads = append(aclNquads, acl.CreateGroupNQuads(x.GuardiansId)...)
aclNquads = append(aclNquads, acl.CreateUserNQuads(x.GrootId, "password")...)
aclNquads = append(aclNquads, &api.NQuad{
Subject: "_:newuser",
Predicate: "dgraph.user.group",
ObjectId: "_:newgroup",
})
nquads.Push(aclNquads...)
}
})
nquads.Flush()
}()

Expand Down
4 changes: 3 additions & 1 deletion dgraph/cmd/bulk/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ func init() {
flag.Bool("new_uids", false,
"Ignore UIDs in load files and assign new ones.")
flag.Uint64("force-namespace", math.MaxUint64,
"Namespace onto which to load the data. If not set, will preserve the namespace.")
"Namespace onto which to load the data. If not set, will preserve the namespace."+
" When using this flag to load data into specific namespace, make sure that the "+
"load data do not have ACL data.")

flag.String("badger", BulkBadgerDefaults, z.NewSuperFlagHelp(BulkBadgerDefaults).
Head("Badger options (Refer to badger documentation for all possible options)").
Expand Down
5 changes: 1 addition & 4 deletions edgraph/access_ee.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,7 @@ func InitializeAcl(closer *z.Closer) {
// The acl feature is not turned on.
return
}

for ns := range schema.State().Namespaces() {
upsertGuardianAndGroot(closer, ns)
}
upsertGuardianAndGroot(closer, x.GalaxyNamespace)
}

// Note: The handling of closer should be done by caller.
Expand Down
4 changes: 2 additions & 2 deletions ee/acl/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ func init() {
Use: "acl",
Short: "Enterprise feature. Not supported in oss version",
Annotations: map[string]string{"group": "security"},
},
Acl.Cmd.SetHelpTemplate(x.NonRootTemplate)
}
CmdAcl.Cmd.SetHelpTemplate(x.NonRootTemplate)
}