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

Fail to set schema with vshard sharding function #91

Closed
AnaNek opened this issue Apr 11, 2022 · 0 comments · Fixed by #98
Closed

Fail to set schema with vshard sharding function #91

AnaNek opened this issue Apr 11, 2022 · 0 comments · Fixed by #98
Assignees
Labels
bug Something isn't working

Comments

@AnaNek
Copy link
Contributor

AnaNek commented Apr 11, 2022

ddl.set_schema(schema) fails with schema containing vshard sharding func. It doesn't matter if vshard module was required on ddl storage. The problem is that checking sharding function in dot notation is performed by checking each item separated by dot in sharding function name, item should be contained in global environment _G. But in vshard sharding function case item routers (field in vshard table) is an empty table because we store schema info on storage. So field bucket_id_strcrc32 is nil in 'vshard.router.bucket_id_strcrc32'.
My proposal is to treat vshard sharding functions as separate cases.

@AnaNek AnaNek added the bug Something isn't working label Apr 11, 2022
@AnaNek AnaNek self-assigned this Apr 11, 2022
AnaNek added a commit that referenced this issue Jul 18, 2022
`ddl.set_schema(schema)` fails with schema containing `vshard` sharding func.
It doesn't matter if vshard module was required on ddl storage.
The problem is that checking sharding function in dot notation
is performed by checking each item separated by dot in sharding
function name, item should be contained in global environment `_G`.
But in vshard sharding function case item `routers` (field in `vshard` table)
is an empty table because we store schema info on storage.
So field `bucket_id_strcrc32` is nil in 'vshard.router.bucket_id_strcrc32'.
Solution is to treat vshard sharding functions as separate cases.

Closes #91
AnaNek added a commit that referenced this issue Jul 22, 2022
`ddl.set_schema(schema)` fails with schema containing `vshard` sharding func.
It doesn't matter if vshard module was required on ddl storage.
The problem is that checking sharding function in dot notation
is performed by checking each item separated by dot in sharding
function name, item should be contained in global environment `_G`.
But in vshard sharding function case item `routers` (field in `vshard` table)
is an empty table because we store schema info on storage.
So field `bucket_id_strcrc32` is nil in 'vshard.router.bucket_id_strcrc32'.
Solution is to treat vshard sharding functions as separate cases.

Closes #91
AnaNek added a commit that referenced this issue Jul 22, 2022
`ddl.set_schema(schema)` fails with schema containing `vshard` sharding func.
It doesn't matter if vshard module was required on ddl storage.
The problem is that checking sharding function in dot notation
is performed by checking each item separated by dot in sharding
function name, item should be contained in global environment `_G`.
But in vshard sharding function case item `routers` (field in `vshard` table)
is an empty table because we store schema info on storage.
So field `bucket_id_strcrc32` is nil in 'vshard.router.bucket_id_strcrc32'.
Solution is to treat vshard sharding functions as separate cases.

Closes #91
AnaNek added a commit that referenced this issue Aug 2, 2022
`ddl.set_schema(schema)` fails with schema containing `vshard` sharding func.
It doesn't matter if vshard module was required on ddl storage.
The problem is that checking sharding function in dot notation
is performed by checking each item separated by dot in sharding
function name, item should be contained in global environment `_G`.
But in vshard sharding function case item `routers` (field in `vshard` table)
is an empty table because we store schema info on storage.
So field `bucket_id_strcrc32` is nil in 'vshard.router.bucket_id_strcrc32'.
Solution is to treat vshard sharding functions as separate cases.

Closes #91
AnaNek added a commit that referenced this issue Aug 3, 2022
`ddl.set_schema(schema)` fails with schema containing `vshard` sharding func.
It doesn't matter if vshard module was required on ddl storage.
The problem is that checking sharding function in dot notation
is performed by checking each item separated by dot in sharding
function name, item should be contained in global environment `_G`.
But in vshard sharding function case item `routers` (field in `vshard` table)
is an empty table because we store schema info on storage.
So field `bucket_id_strcrc32` is nil in 'vshard.router.bucket_id_strcrc32'.
Solution is to treat vshard sharding functions as separate cases.

Closes #91
@AnaNek AnaNek closed this as completed in 23ca61d Aug 3, 2022
@AnaNek AnaNek closed this as completed in #98 Aug 3, 2022
@LeonidVas LeonidVas added the 2sp label Aug 3, 2022
@AnaNek AnaNek mentioned this issue Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants