-
Notifications
You must be signed in to change notification settings - Fork 6
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
Labels
bug
Something isn't working
Comments
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
This was referenced Jul 18, 2022
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
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ddl.set_schema(schema)
fails with schema containing vshard sharding func. It doesn't matter ifvshard
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 itemrouters
(field invshard
table) is an empty table because we store schema info on storage. So fieldbucket_id_strcrc32
is nil in 'vshard.router.bucket_id_strcrc32'.My proposal is to treat vshard sharding functions as separate cases.
The text was updated successfully, but these errors were encountered: