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

sharding func: fix specifying vshard sharding funcs #315

Merged
merged 1 commit into from
Aug 29, 2022

Conversation

AnaNek
Copy link
Contributor

@AnaNek AnaNek commented Jul 22, 2022

Starting from 0.11.0 user can specify sharding func to
calculate bucket_id with sharding func definition as a part of
DDL schema or insert manually to the space _ddl_sharding_func.

Right now ddl fails with setting schema with vshard sharding function
(tarantool/ddl#91).
But even if this bug is fixed, there is also a bug on CRUD side.
Inserting manually to the space _ddl_sharding_func showed
that CRUD search vshard sharding func in _G but this
approach doesn't work with vshard case.

This patch allows to specify vshard sharding func
inserting manually to the space _ddl_sharding_func.

I didn't forget about

  • Tests
  • Changelog
  • Documentation

Closes #314

Copy link
Member

@DifferentialOrange DifferentialOrange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems LGTM, but see my comment below

test/entrypoint/srv_ddl.lua Outdated Show resolved Hide resolved
test/entrypoint/srv_ddl.lua Outdated Show resolved Hide resolved
crud/common/sharding/sharding_func.lua Show resolved Hide resolved
test/entrypoint/srv_ddl.lua Show resolved Hide resolved
@AnaNek AnaNek force-pushed the AnaNek/gh-314-fix-vshard-sharding-func branch from 6c4f6ba to 1d98a49 Compare July 27, 2022 14:12
Copy link
Member

@ligurio ligurio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!
I suppose we need to introduce integration tests with vshard to avoid such unpleasant bugs.
Could you create a ticket and put it to backlog?

See my two minor comments.

test/integration/ddl_sharding_func_test.lua Show resolved Hide resolved
crud/common/sharding/sharding_func.lua Outdated Show resolved Hide resolved
@AnaNek AnaNek force-pushed the AnaNek/gh-314-fix-vshard-sharding-func branch from 1d98a49 to 32d670f Compare July 28, 2022 09:44
Copy link
Member

@ligurio ligurio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after fixing error when vshard function is used, but module is not available (see details in comment)

@AnaNek AnaNek force-pushed the AnaNek/gh-314-fix-vshard-sharding-func branch from 32d670f to 90f0c71 Compare August 23, 2022 18:47
Copy link
Member

@DifferentialOrange DifferentialOrange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ok after resolving remaining comments

test/integration/ddl_sharding_func_test.lua Outdated Show resolved Hide resolved
test/integration/ddl_sharding_func_test.lua Outdated Show resolved Hide resolved
crud/common/sharding/sharding_func.lua Show resolved Hide resolved
test/entrypoint/srv_ddl.lua Show resolved Hide resolved
@AnaNek AnaNek force-pushed the AnaNek/gh-314-fix-vshard-sharding-func branch from 90f0c71 to 3ac0a5e Compare August 25, 2022 13:55
Starting from 0.11.0 user can specify sharding func to
calculate bucket_id with sharding func definition as a part of
DDL schema or insert manually to the space `_ddl_sharding_func`.

Right now ddl fails with setting schema with vshard sharding function.
But even if this bug is fixed, there is also a bug on CRUD side.
Inserting manually to the space `_ddl_sharding_func` showed
that CRUD search vshard sharding func in `_G` but this
approach doesn't work with vshard case.

This patch allows to specify `vshard` sharding func
inserting manually to the space `_ddl_sharding_func`.

Closes #314
@AnaNek AnaNek force-pushed the AnaNek/gh-314-fix-vshard-sharding-func branch from 3ac0a5e to a479871 Compare August 29, 2022 11:09
@DifferentialOrange DifferentialOrange merged commit eb69930 into master Aug 29, 2022
@DifferentialOrange DifferentialOrange deleted the AnaNek/gh-314-fix-vshard-sharding-func branch August 29, 2022 14:47
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

Successfully merging this pull request may close these issues.

Fix specifying vshard sharding func
3 participants