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

Edge document with user provided key is inserted as many times as the number of shards #137

Closed
theoks opened this issue Jun 28, 2018 · 1 comment

Comments

@theoks
Copy link

theoks commented Jun 28, 2018

ArangoDB edition: 3.3.10 Enterprise
ArangoDB go-driver master branch commit c2828ac

I have an edge collection with the following options:

keyOptions := &driver.CollectionKeyOptions{
	AllowUserKeys: true,
}

options := &driver.CreateCollectionOptions{
	ReplicationFactor: 2,
	NumberOfShards:    20,
	Type:              driver.CollectionTypeEdge,
	IndexBuckets:      64,
	KeyOptions:        keyOptions,
}

Then I try with a custom key to add the following document:

LET edge = ( 
	INSERT {
		_key: @key,
		_from: @fromID,
		_to: @toID
	} IN @@edgeCollection 
	RETURN NEW)

RETURN edge

The result is that I have 20 documents added in the collection (equal to the number of shards). If I change the number of shards, the number of the inserted documents still matches the number of shards.

However if I do not use a user provided key the insertion works as expected.

EDIT: I checked the same query through the ArangoDB UI and it seems to work properly, so I presume that this has to do with the driver.

@theoks theoks closed this as completed Jun 29, 2018
@theoks
Copy link
Author

theoks commented Jun 29, 2018

I posted the same issue on the main repo of the database and the engineers could recreate it, so it is not a driver issue. I will post a link whenever there is an actual solution to the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant