fix: block vshard rebalancing during dql
When reading from multiple storages it is possible that some requests will execute faster than the others. And it could lead to wrong results when vhard moved the buckets between nodes. For example: we execute `select * from t` on storage 1 and get the results. Vshard moves the data from storage 1 to stroage 2, and then we execute `select * from t` and in result we get the data (that moved) twice. This commit fixes it by using vshard's storage ref api. Now multi-node read requests first create the ref on each node which blocks vshard rebalancing. Then we call our stored procedure and remove the ref.
Showing
- sbroad-cartridge/src/api/invalidate_cached_schema.rs 1 addition, 1 deletionsbroad-cartridge/src/api/invalidate_cached_schema.rs
- sbroad-cartridge/test_app/test/integration/sql_cache_test.lua 11 additions, 9 deletions...ad-cartridge/test_app/test/integration/sql_cache_test.lua
- sbroad-core/src/backend/sql/ir.rs 1 addition, 1 deletionsbroad-core/src/backend/sql/ir.rs
- sbroad-core/src/core-router.lua 242 additions, 96 deletionssbroad-core/src/core-router.lua
- sbroad-core/src/executor/engine/helpers/vshard.rs 1 addition, 9 deletionssbroad-core/src/executor/engine/helpers/vshard.rs
- sbroad-core/src/helper.lua 17 additions, 0 deletionssbroad-core/src/helper.lua
Loading
Please register or sign in to comment