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

chore: Merge release/v20.07 to release/v20.07-slash #6740

Merged
merged 94 commits into from
Oct 15, 2020

Conversation

abhimanyusinghgaur
Copy link
Contributor

@abhimanyusinghgaur abhimanyusinghgaur commented Oct 15, 2020

Merge release/v20.07-slash with release/v20.07.


This change is Reviewable

Docs Preview: Dgraph Preview

NamanJain8 and others added 30 commits August 19, 2020 12:35
…6239)

* Fix URL paths (#6189)

(cherry picked from commit 4ee4af8)

* fix deploy page to not show blank page

(cherry picked from commit 89e012b)

Co-authored-by: Apoorv Vardhan <vardhanapoorv@users.noreply.github.com>
* Port GraphQL docs to v20.07

This reverts commit 8db61a3.

Co-authored-by: Pawan Rawal <pawan0201@gmail.com>
Co-authored-by: Sankalan Parajuli <sankalan.13@gmail.com>
…6259)

This change also adds a way to set the table and value log loading modes for the w directory
independently of the values for the p directory.

Fixes DGRAPH-1898.

(cherry picked from commit 5f5aa9c)
…6272) (#6276)

Currently a node is marked as visited if it's been visited before AND
has been visited from the same source UID. In dense graphs, the second
condition leads to exponential growth of the data and to other issues
such as responses that are too big to encode.  Removing this condition
fixes the issue.

Fixed tests and verified the new output makes sense.

Fixes DGRAPH-2337

(cherry picked from commit 3638c12)
)

This was being done in the S3 handler but not in the file handler.
By default the paths are sorted by the filename but sorting by backup
number is more robust.

(cherry picked from commit df63d6c)
Clear out the start_ts field in the postings of deltas before they are
marshalled to avoid storing that field in disk. This field is only meant
to be used during in-memory processing.

Related to https://discuss.dgraph.io/t/start-ts-not-being-cleared-before-postings-are-written-to-disk/9146

(cherry picked from commit fbbd731)
Fixes DGRAPH-2181

The queries in dgraph are processed in separate goroutines. The pstore badger DB
could be closed while the query was being processed. This causes panics such as
```
panic: runtime error: invalid memory address or nil pointer dereference
	panic: Unclosed iterator at time of Txn.Discard.
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x11d2311]

goroutine 19298 [running]:
github.com/dgraph-io/badger/v2.(*Txn).Discard(0xc05586bc20)
	/go/pkg/mod/github.com/dgraph-io/badger/v2@v2.0.1-rc1.0.20200718033852-37ee16d8ad1c/txn.go:517 +0xc1
panic(0x19e26a0, 0x2988560)
	/usr/local/go/src/runtime/panic.go:969 +0x166
github.com/dgraph-io/badger/v2/skl.(*Skiplist).IncrRef(...)
```
This PR attempts to reduce the number of such crashes. This PR doesn't fix the actual
issue but it tries to reduce the probability of such crashes by checking if badger is not
closed before accessing it.

An ideal fix would be to stop all the goroutines started by dgraph while closing DB so
that we don't try to read from a closed badger DB.

(cherry picked from commit 3cea0fe)
Backups should be added to the list of tasks (rollups, snapshots, etc)
that are managed by Dgraph so that rollups and other tasks are paused
during the backup.

(cherry picked from commit ea15b66)
This badger update brings the following changes from badger.

https://github.com/dgraph-io/badger/commits/b41e77a Fix(cleanup): Avoid truncating in value.Open on error
https://github.com/dgraph-io/badger/commits/a0d4903 fix(cleanup): Do not close cache before compaction
(cherry picked from commit deded8b)
(cherry picked from commit a8a6e85)

Co-authored-by: Tejas Dinkar <tejas@gja.in>
…quest at a time. (#6339)

It's possible that two requests reach the server around the same time
and send a requests to the alphas with the same backupNum. This could
lead to issues further down the line.

Related to DGRAPH-2295

(cherry picked from commit 5b79260)
… mode for zero. (#6342)

Related to DGRAPH-2189

(cherry picked from commit bf79999)
(cherry picked from commit 844f34d)
Fixes DGRAPH-2357.
Fixes GRAPHQL-562.

(cherry picked from commit 91e28d5)
…#6352)

Fixes DGRAPH-2356
This PR fixes random GraphQL custom logic e2e test failures in TeamCity by requiring docker-compose to always build images before starting the containers, as the mock server in custom logic tests can change any time.

(cherry picked from commit 536b317)
…GQLSchema (#6349) (#6354)

* fix(GraphQL): incorrect generatedSchema in updateGQLSchema (#6349)

This PR fixes the behaviour where Dgraph schema was being given as generatedSchema field in updateGQLSchema request. Now, the newly generated complete GraphQL schema is given as generatedSchema.

(cherry picked from commit 0b8681c)

# Conflicts:
#	graphql/e2e/schema/schema_test.go
martinmr and others added 17 commits October 2, 2020 08:39
The test and utility were assuming that node 1 was in group 1, node 2 in
group 2, and so on. This is not true all the time, hence the flakiness.

Fixing the code to not make this assumptions as well as retrying the
DropAll in NodesSetup to ensure all the nodes are up before proceeding
with the test.

(cherry picked from commit 36638a7)
Enterprise License unit tests
#6634)

fixed : Pagination param "after" does not work when using func: uid(v)
* fix(gqlgen): Update gqlgen in go.mod (#6594)

* Add tests for querying alias and attribute on interface

* Requested changes

(cherry picked from commit f19d882)

* Fix test
This PR fixes incorrect linking of objects with `hasInverse`. For example
For this schema, `type Country` has field `state` with `hasInverse` predicate.
```
type Country {
        id: ID!
        name: String! @search(by: [trigram, hash])
        states: [State] @hasInverse(field: country)
}

type State {
        id: ID!
        xcode: String! @id @search(by: [regexp])
        name: String!
	capital: String
	country: Country
}
```
And for the following mutation
```
mutation addCountry($input: [AddCountryInput!]!) {
			addCountry(input: $input) {
			  country {
				name
				states{
				  xcode
				  name
				  country{
					name
				  }
				}
			  }
			}
		  }
```
with `input`:
```
{
	"input": {
		"name": "A Country",
		"states": [
			{
				"xcode": "abc",
				"name": "Alphabet"
			},
			{
				"xcode": "def",
				"name": "Vowel",
				"country": {
					"name": "B country"
				}
			}
		]
	}
}
```
should result in
```
{
		"addCountry": {
		  "country": [
			{
			  "name": "A country",
			  "states": [
				{
				  "country": {
					"name": "A country"
				  },
				  "name": "Alphabet",
				  "xcode": "abc"
				},
				{
				  "country": {
					"name": "A country"
				  },
				  "name": "Vowel",
				  "xcode": "def"
				}
			  ]
			}
		  ]
		}
	  }`
```
whereas the incorrect output was
```
{
		"addCountry": {
		  "country": [
			{
			  "name": "A country",
			  "states": [
				{
				  "country": {
					"name": "A country"
				  },
				  "name": "Alphabet",
				  "xcode": "abc"
				},
				{
				  "country": {
					"name": "B country"
				  },
				  "name": "Vowel",
				  "xcode": "def"
				}
			  ]
			}
		  ]
		}
	  }`
```
This PR fixes this issue.

(cherry picked from commit e496467)
This PR updates documentation for the `/admin` endpoint operation and  `restore` operation.

(cherry picked from commit 288eafb)
…) (#6647)

(cherry picked from commit cec5567)
This PR fixes: GRAPHQL-638
This is related to GRAPHQL-564. as is Dgraph reserved keyword. It's being used by DQL to identify variables. This PR is to restrict the naming for fields with the name as.
The k-shortest path query sometimes returns a wrong response. The cause
of this issue is inappropriate use of sync.pools. Whenever a valid path
is found a new variable is assigned with this route and that variable is
appended in the kroutes (which is then parsed to produce response).
But the route is also put in the sync.pool. Since the route is a
structure containing a pointer to slice along with other fields, when
it is fetched back from the pool in future then any mutation on this fetched
route causes modification in the kroutes, resulting in garbage response.

This issue is fixed by making a copy of the route struct rather
than just assigning it to a variable, which causes a shallow copy.

(cherry picked from commit 4792d8b)
(cherry picked from commit a8a47af)

Co-authored-by: Manish R Jain <manish@dgraph.io>
Fixes DGRAPH-2419
Fixes [Discuss Issue](https://discuss.dgraph.io/t/acl-login-will-fail-if-auth-token-enabled-in-v20-07-0/10044)

This PR fixes Poor-man's auth for following endpoints:
* `/login`
* `/admin`

(cherry picked from commit 4fc328d)

# Conflicts:
#	graphql/e2e/common/common.go
…imanyu/release-slash-merge

# Conflicts:
#	dgraph/cmd/alpha/run.go
#	dgraph/cmd/bulk/reduce.go
#	dgraph/cmd/zero/raft.go
#	edgraph/server.go
#	go.mod
#	go.sum
#	graphql/e2e/common/common.go
#	graphql/e2e/common/fragment.go
#	graphql/e2e/common/mutation.go
#	graphql/e2e/common/query.go
#	graphql/e2e/custom_logic/custom_logic_test.go
#	graphql/e2e/directives/schema_response.json
#	graphql/e2e/normal/schema_response.json
#	graphql/e2e/schema/generatedSchema.graphql
#	graphql/resolve/resolver.go
#	graphql/schema/testdata/schemagen/output/type-without-orderables.graphql
#	protos/pb/pb.pb.go
#	wiki/content/enterprise-features/binary-backups.md
#	wiki/content/graphql/admin/index.md
#	wiki/content/graphql/schema/reserved.md
…imanyu/release-slash-merge

# Conflicts:
#	dgraph/cmd/alpha/run.go
#	dgraph/cmd/bulk/reduce.go
#	dgraph/cmd/zero/raft.go
#	edgraph/server.go
#	go.mod
#	go.sum
#	graphql/e2e/common/common.go
#	graphql/e2e/common/fragment.go
#	graphql/e2e/common/mutation.go
#	graphql/e2e/common/query.go
#	graphql/e2e/custom_logic/custom_logic_test.go
#	graphql/e2e/directives/schema_response.json
#	graphql/e2e/normal/schema_response.json
#	graphql/e2e/schema/generatedSchema.graphql
#	graphql/resolve/resolver.go
#	graphql/schema/testdata/schemagen/output/type-without-orderables.graphql
#	protos/pb/pb.pb.go
#	wiki/content/enterprise-features/binary-backups.md
#	wiki/content/graphql/admin/index.md
#	wiki/content/graphql/schema/reserved.md
@github-actions github-actions bot added area/bulk-loader Issues related to bulk loading. area/enterprise Related to proprietary features area/documentation Documentation related issues. area/graphql Issues related to GraphQL support on Dgraph. area/integrations Related to integrations with other projects. labels Oct 15, 2020
@abhimanyusinghgaur abhimanyusinghgaur merged commit 158680a into release/v20.07-slash Oct 15, 2020
@abhimanyusinghgaur abhimanyusinghgaur deleted the abhimanyu/release-slash-merge branch October 15, 2020 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bulk-loader Issues related to bulk loading. area/documentation Documentation related issues. area/enterprise Related to proprietary features area/graphql Issues related to GraphQL support on Dgraph. area/integrations Related to integrations with other projects.
Development

Successfully merging this pull request may close these issues.