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

ERR The ID specified in XADD is equal or smaller than the target stream top item #814

Open
alkazap opened this issue May 29, 2024 · 8 comments
Labels
type: question Further information is requested

Comments

@alkazap
Copy link

alkazap commented May 29, 2024

Issue Description

RedisShake errors out whenever it receives XADD command

Environment

  • RedisShake Version:latest
  • Redis Source Version:latest
  • Redis Destination Version:latest
  • Redis 部署方式(standalone/cluster/sentinel):standalone -> sentinel
  • Deployed on Cloud Provider:Kubernetes cluster (also tested using Docker Compose)

Logs

2024-05-29 08:07:18 INF load config from file: shake.toml
2024-05-29 08:07:18 INF log_level: [info], log_file: [/usr/src/app/RedisShake/bin/data/shake.log]
2024-05-29 08:07:18 INF changed work dir. dir=[/usr/src/app/RedisShake/bin/data]
2024-05-29 08:07:18 INF GOMAXPROCS defaults to the value of runtime.NumCPU [32]
2024-05-29 08:07:18 INF not set pprof port
2024-05-29 08:07:18 INF create SyncStandaloneReader: dev-redis-replicas-0.dev-redis-headless.dev-redis:6379
2024-05-29 08:07:18 INF create RedisStandaloneWriter: dev-redis-ha.dev-redis-ha:6379
2024-05-29 08:07:18 INF not set status port
2024-05-29 08:07:18 INF start syncing...
2024-05-29 08:07:18 ERR [writer_dev-redis-ha.dev-redis-ha_6379] receive reply failed. cmd=[xadd nlp:sync:output:4bcce72b-cb24-4b54-949e-867a9f769364:stream 1709602510226-0 debug {"nlp_summary...], error=[ERR The ID specified in XADD is equal or smaller than the target stream top item]
			RedisShake/internal/writer/redis_standalone_writer.go:116 -> (*redisStandaloneWriter).processReply()
			runtime/asm_amd64.s:1695 -> goexit()
@alkazap alkazap added the type: question Further information is requested label May 29, 2024
@suxb201
Copy link
Member

suxb201 commented May 29, 2024

Could you check if there are any xadd operations being performed on the destination Redis instance? These operations might be causing the issue you’re encountering.

@alkazap
Copy link
Author

alkazap commented May 29, 2024

right there are XADD operations being performed. Does it mean that RedisShake can't sync those?

@alkazap
Copy link
Author

alkazap commented May 30, 2024

my bad, I did not read your question carefully. XADD operations are only performed on the source Redis, not destination. I found that you create Redis Stream with "0-1" #808. I wonder if that is causing this issue.

@alkazap
Copy link
Author

alkazap commented May 30, 2024

I am first performing XREAD command with "0-0" and then XADD uses appended ID "0-1" (not set by default)

Sometimes XADD happens before XREAD

@alkazap alkazap changed the title Can RedisShake handle Redis Streams? ERR The ID specified in XADD is equal or smaller than the target stream top item May 30, 2024
@suxb201
Copy link
Member

suxb201 commented May 30, 2024

I can't think of a reason for now.

@alkazap
Copy link
Author

alkazap commented May 30, 2024

So I went ahead and deleted the stream from src and dest, restarted RedisShake and error changed:

2024-05-30 02:39:52 INF load config from file: shake.toml
2024-05-30 02:39:52 INF log_level: [info], log_file: [/usr/src/app/RedisShake/bin/data/shake.log]
2024-05-30 02:39:52 INF changed work dir. dir=[/usr/src/app/RedisShake/bin/data]
2024-05-30 02:39:52 INF GOMAXPROCS defaults to the value of runtime.NumCPU [32]
2024-05-30 02:39:52 INF not set pprof port
2024-05-30 02:39:52 INF create SyncStandaloneReader: dev-redis-replicas-0.dev-redis-headless.dev-redis:6379
2024-05-30 02:39:52 INF connecting to master node at dev-redis-ha-node-0.dev-redis-ha-headless.dev-redis-ha.svc.cluster.local:6379
2024-05-30 02:39:52 INF create RedisSentinelWriter: dev-redis-ha.dev-redis-ha:26379
2024-05-30 02:39:52 INF not set status port
2024-05-30 02:39:52 INF start syncing...
2024-05-30 02:39:52 ERR [writer_dev-redis-ha-node-0.dev-redis-ha-headless.dev-redis-ha.svc.cluster.local_6379] receive reply failed. cmd=[xadd nlp:sync:output:4bcce72b-cb24-4b54-949e-867a9f769364:stream MAXLEN 0 0-1 x y], error=[ERR The ID specified in XADD is equal or smaller than the target stream top item]
			RedisShake/internal/writer/redis_standalone_writer.go:116 -> (*redisStandaloneWriter).processReply()
			runtime/asm_amd64.s:1695 -> goexit()

before: receive reply failed. cmd=[xadd nlp:sync:output:4bcce72b-cb24-4b54-949e-867a9f769364:stream 1709602510226-0

after: receive reply failed. cmd=[xadd nlp:sync:output:4bcce72b-cb24-4b54-949e-867a9f769364:stream MAXLEN 0 0-1 x y]

@suxb201
Copy link
Member

suxb201 commented May 30, 2024

@alkazap
Copy link
Author

alkazap commented May 30, 2024

Thank you, that's a good temporary fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants