From 0f8fc57ce0fefd5e27c7ffacd82b03f2273f6163 Mon Sep 17 00:00:00 2001 From: Georgiy Lebedev Date: Thu, 26 Oct 2023 17:25:38 +0300 Subject: [PATCH 1/2] router: add box tuple case for shard key hashing In scope of tarantool/tarantool#8147, box tuples returned from remote procedure calls our now encoded as a new extension, `MP_TUPLE`, and, consequently, the results of such calls are now decoded as box tuples. For compatibility with this feature, we need to add this case to shard key hashing. Since box tuples are semantically equivalent to Lua tables, we can process them the same way. Needed for tarantool/tarantool#8147 NO_DOC= NO_TEST= --- vshard/hash.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vshard/hash.lua b/vshard/hash.lua index 477b312f..d1260868 100644 --- a/vshard/hash.lua +++ b/vshard/hash.lua @@ -39,7 +39,7 @@ end -- double. -- local function mpcrc32(shard_key) - if type(shard_key) ~= 'table' then + if type(shard_key) ~= 'table' and not box.tuple.is(shard_key) then return ldigest.crc32(mpcrc32_one(shard_key)) else local crc32 = ldigest.crc32.new() From a2c46329de088c1e1c69893318ddaa837a96e2e7 Mon Sep 17 00:00:00 2001 From: Georgiy Lebedev Date: Thu, 26 Oct 2023 17:32:06 +0300 Subject: [PATCH 2/2] [DO NOT MERGE] ci: test on tarantool/tarantool#8630 Temporarily add tarantool/tarantool#8630 to test matrix. NO_DOC= NO_TEST= --- .github/workflows/fast_testing.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fast_testing.yml b/.github/workflows/fast_testing.yml index d1b78152..c88ffd65 100644 --- a/.github/workflows/fast_testing.yml +++ b/.github/workflows/fast_testing.yml @@ -33,6 +33,7 @@ jobs: - '2.8' - '2.10' - 'release-master' + - 'pr/8630' env: TNT_RELEASE_PATH: /home/runner/tnt-release @@ -40,7 +41,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Install tarantool ${{ matrix.tarantool }} - if: startsWith(matrix.tarantool, 'release') != true + if: matrix.tarantool != 'release-master' && matrix.tarantool != 'pr/8630' uses: tarantool/setup-tarantool@v2 with: tarantool-version: ${{ matrix.tarantool }} @@ -72,8 +73,18 @@ jobs: fetch-depth: 0 submodules: true + - name: Clone tarantool fork with ${{ matrix.tarantool }} + if: matrix.tarantool == 'pr/8630' + uses: actions/checkout@v3 + with: + repository: curiousgeorgiy/tarantool + ref: gh-8147-tuple-formats-in-iproto-responses + path: tarantool + fetch-depth: 0 + submodules: true + - name: Build tarantool ${{ matrix.tarantool }} - if: startsWith(matrix.tarantool, 'release') && steps.cache-tnt-release.outputs.cache-hit != 'true' + if: (startsWith(matrix.tarantool, 'release') && steps.cache-tnt-release.outputs.cache-hit != 'true') || matrix.tarantool == 'pr/8630' run: | sudo apt-get -y install build-essential cmake make zlib1g-dev libreadline-dev libncurses5-dev \ libssl-dev libunwind-dev libicu-dev python3 python3-yaml python3-six python3-gevent @@ -83,7 +94,7 @@ jobs: make && make DESTDIR=${TNT_RELEASE_PATH} install - name: Install tarantool ${{ matrix.tarantool }} - if: startsWith(matrix.tarantool, 'release') + if: startsWith(matrix.tarantool, 'release') || matrix.tarantool == 'pr/8630' # Workaround as actions/cache cannot restore data to /usr/local run: sudo cp -rvP ${TNT_RELEASE_PATH}/usr/local/* /usr/local/