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

遇到 txn replOnly 异常如何解决 #254

Open
shuqin opened this issue Nov 15, 2023 · 1 comment
Open

遇到 txn replOnly 异常如何解决 #254

shuqin opened this issue Nov 15, 2023 · 1 comment

Comments

@shuqin
Copy link

shuqin commented Nov 15, 2023

问题描述

使用 tendis 替换 Redis,客户端是 lettuce, 调用到 这段代码的 commands.scriptLoad 时抛了异常。

private <T> T doExecuteNoScript( RedisScriptingCommands<String, byte[]> commands, RedisScript script, String[] keys, byte[][] values) { commands.scriptLoad(script.getScriptAsBytes()); return doExecute(commands, script, keys, values); }

/** * Load the specified Lua script into the script cache. * * @param script script content * @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache. */ String scriptLoad(V script);

script 是

private static final RedisScript GET_AND_DEL_SCRIPT = RedisScript.common( "local v = redis.call('hget', KEYS[1], ARGV[1]); " + "redis.call('hdel', KEYS[1], ARGV[1]); " + "return v;", null);

期望行为

正常执行。

疑问: replOnly 是什么含义? 是不是需要配置什么才能规避这个问题?

Current Behavior

抛了异常

遇到一个异常 Err 3 msg: txn replOnly。
txnreplonly错误

Possible Solution

Steps to Reproduce (for bugs)

Context

信创项目。 影响 使用 tendis 替换 redis 的项目进度。需要解决。不然只能绕开。

Your Environment

  • Operating System and version: 容器化部署环境
  • Machine Specifications: 8C 32G
  • Tendis Version: 3.6.3
  • Tendis Configuration:
    cluster-require-full-coverage no
    port PORT
    bind IP
    daemon false
    loglevel debug
    logdir DIR/data/log
    dumpdir DIR/data/dump
    dir DIR/data/db
    pidfile DIR/PORT/tendisplus.pid
    slowlog DIR/data/log/slowlog
    rocks.blockcachemb 4096
    storage rocks
    generallog 0
    checkkeytypeforsetcmd off
    cluster-enabled true
    domain-enabled true
    masterauth {{ readSec
  • IO/Network used:
  • Link to your project:
@takenliu
Copy link
Collaborator

像是请求发送到从节点去了?

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

No branches or pull requests

2 participants