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

[BUG]: moveTablet endpoint doesn't work. #291

Open
MichelDiz opened this issue Nov 26, 2022 · 3 comments
Open

[BUG]: moveTablet endpoint doesn't work. #291

MichelDiz opened this issue Nov 26, 2022 · 3 comments
Labels
kind/bug Something is broken.

Comments

@MichelDiz
Copy link
Contributor

MichelDiz commented Nov 26, 2022

What version of Dgraph are you using?

v22.0.1

Tell us a little more about your go-environment?

N/A

Have you tried reproducing the issue with the latest release?

No response

What is the hardware spec (RAM, CPU, OS)?

N/A

What steps will reproduce the bug?

http://localhost:6080/moveTablet?tablet=%00%00%00%00%00%00%00%00HAS&group=2

response:

{"errors":[{"message":"namespace: 0. No tablet found for: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000HAS","extensions":{"code":"ErrorInvalidRequest"}}]}
{"errors":[{"message":"namespace: 0. No tablet found for: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000REGISTERS","extensions":{"code":"ErrorInvalidRequest"}}]}
curl "http://localhost:6080/moveTablet?tablet=%00%00%00%00%00%00%00%00REGISTERS&group=2"
{"errors":[{"message":"namespace: 0. No tablet found for: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000REGISTERS","extensions":{"code":"ErrorInvalidRequest"}}]}

Expected behavior and actual result.

"message": "namespace: 0. Predicate: [HAS] moved from group [3] to [4]"

It is related to dgraph-io/dgraph#8389

Additional information

It is possible to move via GraphQL

mutation moveTB {
	moveTablet(input: {namespace:0, tablet:"HAS", groupId: 4}){
		response {
			code
			message
		}
	}
}
{
	"data": {
		"moveTablet": {
			"response": {
				"code": "Success",
				"message": "namespace: 0. Predicate: [HAS] moved from group [3] to [4]"
			}
		}
	},
	"extensions": {
		"tracing": {
			"version": 1,
			"startTime": "2022-11-26T23:47:17.552849165Z",
			"endTime": "2022-11-26T23:47:18.380343262Z",
			"duration": 827494097
		}
	}
}

And if you remove the binary prefix it works again

http://localhost:6080/moveTablet?tablet=name&group=2
@MichelDiz MichelDiz added the kind/bug Something is broken. label Nov 26, 2022
@MichelDiz MichelDiz transferred this issue from dgraph-io/dgraph Nov 27, 2022
@matthewmcneely
Copy link

I think this bug should be in the dgraph repo, but in the meantime...

Tablet names are encoded along with their namespace in storage. See here. I think the "fix" would be to ensure that wherever tablet names are presented to users, i.e., dgraph-io/dgraph#8389, that they are converted properly as strings.

@MichelDiz
Copy link
Contributor Author

I think if we solve 8389 + 8451 and make sure all logs and responses are formated well. This issue with Ratel will fix by itself.

We could fix it in Ratel. Via some function. But it is preferable that it is in Dgraph's Core Code. I just don't know which one will take longer. So leave this issue here, as it is in theory a duplicate of 8389 + 8451. Right? Leave it here so that users can see that the problem exists and the reasons.

@matthewmcneely
Copy link

as it is in theory a duplicate of 8389 + 8451. Right?

Agreed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something is broken.
Projects
None yet
Development

No branches or pull requests

2 participants