Skip to content

ddl: fix error on explicit bucket_id #280

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

Merged

Conversation

DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented May 6, 2022

After introducing sharding hash info comparison, requests with ddl and
explicit bucket_id in options started to fail with
"Sharding hash mismatch" error. It affects the following methods:

  • insert
  • insert_object
  • replace
  • replace_object
  • upsert
  • upsert_object
  • count

The situation is as follows. Due to a code mistake, router hasn't passed
a sharding hash with a request if bucket_id was specified. If there was
any ddl information for a space on storage, it has caused a hash
mismatch error. Since sharding info reload couldn't fix broken hash
extraction, request failed after a number of retries. This patch fixes
this behavior by skipping hash comparison if sharding info wasn't used
(we already do it in other methods).

  • Tests
  • Changelog
  • Documentation

Closes #278

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-278-sharding-mismatch branch from 54f278c to 5d06934 Compare May 6, 2022 09:06
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

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

Conceptually ok for me. Let's push and release 0.11.1.

I would explain what is going wrong in the pull request (and commit) description a bit more.

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-278-sharding-mismatch branch from 5d06934 to 5609298 Compare May 6, 2022 12:33
@DifferentialOrange
Copy link
Member Author

I would explain what is going wrong in the pull request (and commit) description a bit more.

Added a better description.

After introducing sharding hash info comparison [1], requests with ddl
and explicit bucket_id in options started to fail with
"Sharding hash mismatch" error. It affected following methods:
- insert
- insert_object
- replace
- replace_object
- upsert
- upsert_object
- count

The situation is as follows. Due to a code mistake, router hasn't passed
a sharding hash with a request if bucket_id was specified. If there was
any ddl information for a space on storage, it has caused a hash
mismatch error. Since sharding info reload couldn't fix broken hash
extraction, request failed after a number of retries. This patch fixes
this behavior by skipping hash comparison if sharding info wasn't used
(we already do it in other methods).

1. #268

Closes #278
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-278-sharding-mismatch branch from 5609298 to 6225fad Compare May 6, 2022 14:09
@DifferentialOrange DifferentialOrange merged commit 6a4d4e9 into master May 6, 2022
@DifferentialOrange DifferentialOrange deleted the DifferentialOrange/gh-278-sharding-mismatch branch May 6, 2022 15:01
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.

CRUD 0.11.0 incompatible with old-style apps when bucket_id is defined explicitly
2 participants