tarantool / ddl

The DDL module enables you to describe data schema in a declarative YAML-based format.
BSD 2-Clause "Simplified" License
12 stars 6 forks source link

Wrong assumption for sharding_index name #68

Open ligurio opened 3 years ago

ligurio commented 3 years ago

vshard configuration has an option to specify a name or id of sharding index, by default it values is 'bucket_id'. It's up to the user to change it or keep the default value [1].

Source code of ddl/check.lua has a wrong assumption for sharding index name:

  1. https://www.tarantool.io/en/doc/latest/reference/reference_rock/vshard/vshard_ref/#confval-shard_index
rosik commented 3 years ago

The decision to make it so strict was conscious. We've interviewed many vshard users, and they all agreed that the custom sharding index is confusing.

Totktonada commented 2 years ago

Well, let's wait until someone will ask for that.

R-omk commented 1 year ago

More on the topic:

https://github.com/tarantool/ddl/blob/master/ddl/check.lua#L641

index of %s type can't be composite

This is not a correct statement.

We always use a composite index for sharding. The tail of such index is a surrogate or natural key and whole index is primary key for space.

https://github.com/tarantool/vshard/blob/b3c27b32637863e9a03503e641bb7c8c69779a00/vshard/storage/init.lua#L1835C18-L1836