kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

Kvrocks sends negative ttl while migrating slot

Open ellutionist opened this issue 2 years ago • 3 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

OS: Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04

Kvrocks: v2.1.0

Minimal reproduce step

  1. Create a kvrocks cluster of 2 nodes:
127.0.0.1:6666> cluster nodes
KEp2lfd524nItcLDNm=nkrTgxxRa2OnyfCorGqiw 127.0.0.1:6666@16666 myself,master - 1663582260999 1663582261000 1 connected 0-8191
iv3zxA39N1kXg23BmGAchLynaNCG2K284QvpgklT 127.0.0.1:6667@16667 master - 1663582260999 1663582261000 1 connected 8192-16383
  1. Set a key into one node, which expres in 5 seconds:
127.0.0.1:6666> set key00000000000000007100 key00000000000000007100 ex 5
OK
  1. Check the slot:
127.0.0.1:6666> cluster keyslot key00000000000000007100
(integer) 35
  1. After 5 seconds, migrate the slot to the other node, the migration will fail:
127.0.0.1:6666> clusterx migrate 35 iv3zxA39N1kXg23BmGAchLynaNCG2K284QvpgklT
OK
127.0.0.1:6666> cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:2
cluster_size:2
cluster_current_epoch:1
cluster_my_epoch:1
migrating_slot: 35
destination_node: iv3zxA39N1kXg23BmGAchLynaNCG2K284QvpgklT
migrating_state: fail
  1. Error log:
E20220919 18:14:55.837342 639656 slot_migrate.cc:495] [migrate] Got invalid response: -ERR invalid expire time, line length: 24
E20220919 18:14:55.837354 639656 slot_migrate.cc:793] [migrate] Wrong response
E20220919 18:14:55.837363 639656 slot_migrate.cc:320] [migrate] Failed to send left data in pipeline
E20220919 18:14:55.837378 639656 slot_migrate.cc:182] [migrate] Failed to send snapshot
I20220919 18:14:55.837489 639656 slot_migrate.cc:211] [migrate] Failed to migrate slot35
I20220919 18:14:55.837498 639656 slot_migrate.cc:380] [migrate] Clean resources of migrating slot 35

What did you expect to see?

Migrate success when executing cluster info.

What did you see instead?

Migrate failed.

Anything Else?

No response

Are you willing to submit a PR?

  • [X] I'm willing to submit a PR!

ellutionist avatar Sep 19 '22 10:09 ellutionist

Cool, thanks for your feedback.

git-hulk avatar Sep 19 '22 11:09 git-hulk

Looking forward to your PR

xiaobiaozhao avatar Sep 20 '22 00:09 xiaobiaozhao

Indeed, this is a bug. For expired keys, we should filter them out at the source side.

caipengbo avatar Sep 20 '22 02:09 caipengbo

@ellutionist @git-hulk @caipengbo shall we close this issue as completed with https://github.com/apache/incubator-kvrocks/pull/901?

tisonkun avatar Oct 04 '22 03:10 tisonkun

Yes, sorry for forgetting this issue.

git-hulk avatar Oct 04 '22 11:10 git-hulk