Add endurance testing to better detect threading bugs
Former-commit-id: 945e428aa110968479fdcdfc2d5c5308a99eadc3
This commit is contained in:
parent
0c5585e5de
commit
40fdb3ce05
@ -2537,6 +2537,7 @@ standardConfig configs[] = {
|
|||||||
createBoolConfig("io-threads-do-reads", NULL, IMMUTABLE_CONFIG, fDummy, 0, NULL, NULL),
|
createBoolConfig("io-threads-do-reads", NULL, IMMUTABLE_CONFIG, fDummy, 0, NULL, NULL),
|
||||||
createBoolConfig("time-thread-priority", NULL, IMMUTABLE_CONFIG, cserver.time_thread_priority, 0, NULL, NULL),
|
createBoolConfig("time-thread-priority", NULL, IMMUTABLE_CONFIG, cserver.time_thread_priority, 0, NULL, NULL),
|
||||||
createBoolConfig("prefetch-enabled", NULL, MODIFIABLE_CONFIG, g_pserver->prefetch_enabled, 1, NULL, NULL),
|
createBoolConfig("prefetch-enabled", NULL, MODIFIABLE_CONFIG, g_pserver->prefetch_enabled, 1, NULL, NULL),
|
||||||
|
createBoolConfig("allow-rdb-resize-op", NULL, MODIFIABLE_CONFIG, g_pserver->allowRdbResizeOp, 1, NULL, NULL),
|
||||||
|
|
||||||
/* String Configs */
|
/* String Configs */
|
||||||
createStringConfig("aclfile", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->acl_filename, "", NULL, NULL),
|
createStringConfig("aclfile", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->acl_filename, "", NULL, NULL),
|
||||||
|
@ -2699,9 +2699,11 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
|
|||||||
goto eoferr;
|
goto eoferr;
|
||||||
if ((expires_size = rdbLoadLen(rdb,NULL)) == RDB_LENERR)
|
if ((expires_size = rdbLoadLen(rdb,NULL)) == RDB_LENERR)
|
||||||
goto eoferr;
|
goto eoferr;
|
||||||
wqueue.enqueue([dbCur, db_size]{
|
if (g_pserver->allowRdbResizeOp) {
|
||||||
dbCur->expand(db_size);
|
wqueue.enqueue([dbCur, db_size]{
|
||||||
});
|
dbCur->expand(db_size);
|
||||||
|
});
|
||||||
|
}
|
||||||
continue; /* Read next opcode. */
|
continue; /* Read next opcode. */
|
||||||
} else if (type == RDB_OPCODE_AUX) {
|
} else if (type == RDB_OPCODE_AUX) {
|
||||||
/* AUX: generic string-string fields. Use to add state to RDB
|
/* AUX: generic string-string fields. Use to add state to RDB
|
||||||
|
@ -2161,6 +2161,7 @@ struct redisServer {
|
|||||||
sds aof_child_diff; /* AOF diff accumulator child side. */
|
sds aof_child_diff; /* AOF diff accumulator child side. */
|
||||||
int aof_rewrite_pending = 0; /* is a call to aofChildWriteDiffData already queued? */
|
int aof_rewrite_pending = 0; /* is a call to aofChildWriteDiffData already queued? */
|
||||||
/* RDB persistence */
|
/* RDB persistence */
|
||||||
|
int allowRdbResizeOp; /* Debug situations we may want rehash to be ocurring, so ignore resize */
|
||||||
long long dirty; /* Changes to DB from the last save */
|
long long dirty; /* Changes to DB from the last save */
|
||||||
long long dirty_before_bgsave; /* Used to restore dirty on failed BGSAVE */
|
long long dirty_before_bgsave; /* Used to restore dirty on failed BGSAVE */
|
||||||
struct _rdbThreadVars
|
struct _rdbThreadVars
|
||||||
|
@ -189,3 +189,15 @@ test {client freed during loading} {
|
|||||||
exec kill [srv 0 pid]
|
exec kill [srv 0 pid]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test {repeated load} {
|
||||||
|
start_server [list overrides [list server-threads 3 allow-rdb-resize-op no]] {
|
||||||
|
r debug populate 500000 key 1000
|
||||||
|
|
||||||
|
set digest [r debug digest]
|
||||||
|
for {set j 0} {$j < 10} {incr j} {
|
||||||
|
r debug reload
|
||||||
|
assert_equal $digest [r debug digest]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user