Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b6e6f6c1e | ||
|
|
b0a0f03b96 | ||
|
|
f1982ca63d | ||
|
|
25e18a7de9 |
No files matched your search
@@ -3930,6 +3930,8 @@ void RM_FreeThreadSafeContext(RedisModuleCtx *ctx) {
|
||||
void RM_ThreadSafeContextLock(RedisModuleCtx *ctx) {
|
||||
UNUSED(ctx);
|
||||
moduleAcquireGIL(FALSE /*fServerThread*/);
|
||||
if (serverTL == nullptr)
|
||||
serverTL = &g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN]; // arbitrary module threads get the main thread context
|
||||
}
|
||||
|
||||
/* Release the server lock after a thread safe API call was executed. */
|
||||
|
||||
+7
-2
@@ -3265,11 +3265,16 @@ void replicaReplayCommand(client *c)
|
||||
cFake->lock.lock();
|
||||
cFake->authenticated = c->authenticated;
|
||||
cFake->puser = c->puser;
|
||||
cFake->querybuf = sdscat(cFake->querybuf,(sds)ptrFromObj(c->argv[2]));
|
||||
cFake->querybuf = sdscatsds(cFake->querybuf,(sds)ptrFromObj(c->argv[2]));
|
||||
selectDb(cFake, c->db->id);
|
||||
auto ccmdPrev = serverTL->commandsExecuted;
|
||||
processInputBuffer(cFake, (CMD_CALL_FULL & (~CMD_CALL_PROPAGATE)));
|
||||
bool fExec = ccmdPrev != serverTL->commandsExecuted;
|
||||
cFake->lock.unlock();
|
||||
addReply(c, shared.ok);
|
||||
if (fExec)
|
||||
addReply(c, shared.ok);
|
||||
else
|
||||
addReplyError(c, "command did not execute");
|
||||
freeClient(cFake);
|
||||
serverTL->current_client = current_clientSave;
|
||||
|
||||
|
||||
@@ -3348,6 +3348,7 @@ void call(client *c, int flags) {
|
||||
dirty = g_pserver->dirty;
|
||||
start = ustime();
|
||||
c->cmd->proc(c);
|
||||
serverTL->commandsExecuted++;
|
||||
duration = ustime()-start;
|
||||
dirty = g_pserver->dirty-dirty;
|
||||
if (dirty < 0) dirty = 0;
|
||||
|
||||
@@ -1159,6 +1159,7 @@ struct redisServerThreadVars {
|
||||
client *lua_client = nullptr; /* The "fake client" to query Redis from Lua */
|
||||
struct fastlock lockPendingWrite;
|
||||
char neterr[ANET_ERR_LEN]; /* Error buffer for anet.c */
|
||||
long unsigned commandsExecuted = 0;
|
||||
};
|
||||
|
||||
struct redisMaster {
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
#define KEYDB_REAL_VERSION "0.0.0"
|
||||
#define KEYDB_REAL_VERSION "5.0.0"
|
||||
extern const char *KEYDB_SET_VERSION; // Unlike real version, this can be overriden by the config
|
||||
|
||||
@@ -49,6 +49,15 @@ start_server {tags {"active-repl"} overrides {active-replica yes}} {
|
||||
}
|
||||
}
|
||||
|
||||
test {Active replicas propogate binary} {
|
||||
$master set binkey "\u0000foo"
|
||||
wait_for_condition 50 500 {
|
||||
[string match *foo* [$slave get binkey]]
|
||||
} else {
|
||||
fail "replication failed to propogate binary data"
|
||||
}
|
||||
}
|
||||
|
||||
test {Active replicas WAIT} {
|
||||
# Test that wait succeeds since replicas should be syncronized
|
||||
$master set testkey foo
|
||||
|
||||
Reference in new issue
Block a user