@@ -144,7 +144,7 @@ struct redisCommand redisCommandTable[] = {
144
144
{"decr" ,decrCommand ,2 ,"wmF" ,0 ,NULL ,1 ,1 ,1 ,0 ,0 },
145
145
{"mget" ,mgetCommand ,-2 ,"r" ,0 ,NULL ,1 ,-1 ,1 ,0 ,0 },
146
146
{"rpush" ,rpushCommand ,-3 ,"wmF" ,0 ,NULL ,1 ,1 ,1 ,0 ,0 },
147
- {"lpush" ,lpushCommand ,-3 , "wmF " ,0 ,NULL ,1 ,1 ,1 ,0 ,0 },
147
+ {"lpush" ,lpushCommand ,-5 , "wmFO " ,0 ,NULL ,1 ,1 ,1 ,0 ,0 },
148
148
{"rpushx" ,rpushxCommand ,3 ,"wmF" ,0 ,NULL ,1 ,1 ,1 ,0 ,0 },
149
149
{"lpushx" ,lpushxCommand ,3 ,"wmF" ,0 ,NULL ,1 ,1 ,1 ,0 ,0 },
150
150
{"linsert" ,linsertCommand ,5 ,"wm" ,0 ,NULL ,1 ,1 ,1 ,0 ,0 },
@@ -1296,6 +1296,8 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
1296
1296
run_with_period (1000 ) {
1297
1297
/* If server haven't received client's replay request for a while,
1298
1298
* assume completion of recover and start normal processing. */
1299
+ // TODO(seojin): check recovered by witness. And don't wait if
1300
+ // recovered by witness.
1299
1301
if (server .serverState == SERVER_STATE_ACCEPTING_REPLAY &&
1300
1302
server .unixtime - server .last_client_replay > SECONDS_WAITING_REPLAY ) {
1301
1303
server .serverState = SERVER_STATE_NORMAL ;
@@ -1482,6 +1484,8 @@ void initServerConfig(void) {
1482
1484
server .currentOpNum = 0 ;
1483
1485
server .port = CONFIG_DEFAULT_SERVER_PORT ;
1484
1486
server .portForRecovery = CONFIG_DEFAULT_RECOVERY_PORT ;
1487
+ server .last_client_connected_usec = 0 ;
1488
+ server .last_client_connected_opNum = 0 ;
1485
1489
server .tcp_backlog = CONFIG_DEFAULT_TCP_BACKLOG ;
1486
1490
server .bindaddr_count = 0 ;
1487
1491
server .unixsocket = NULL ;
@@ -1506,6 +1510,7 @@ void initServerConfig(void) {
1506
1510
server .supervised_mode = SUPERVISED_NONE ;
1507
1511
server .aof_state = AOF_OFF ;
1508
1512
server .aof_fsync = CONFIG_DEFAULT_AOF_FSYNC ;
1513
+ server .must_aof_fsync = false;
1509
1514
server .aof_no_fsync_on_rewrite = CONFIG_DEFAULT_AOF_NO_FSYNC_ON_REWRITE ;
1510
1515
server .aof_rewrite_perc = AOF_REWRITE_PERC ;
1511
1516
server .aof_rewrite_min_size = AOF_REWRITE_MIN_SIZE ;
@@ -2296,8 +2301,13 @@ void call(client *c, int flags) {
2296
2301
2297
2302
// RIFL check.
2298
2303
if (c -> cmd -> flags & CMD_AT_MOST_ONCE ) {
2299
- getLongLongFromObject (c -> argv [c -> argc - 2 ], & c -> clientId );
2300
- getLongLongFromObject (c -> argv [c -> argc - 1 ], & c -> requestId );
2304
+ // getLongLongFromObject(c->argv[c->argc-2], &c->clientId);
2305
+ // getLongLongFromObject(c->argv[c->argc-1], &c->requestId);
2306
+ getLongLongFromObjectInBase64 (c -> argv [c -> argc - 2 ], & c -> clientId );
2307
+ getLongLongFromObjectInBase64 (c -> argv [c -> argc - 1 ], & c -> requestId );
2308
+
2309
+ // serverLog(LL_NOTICE,"clientId: %lld, requestId: %lld", c->clientId, c->requestId);
2310
+
2301
2311
if (!riflCheckClientIdOk (c )) {
2302
2312
addReply (c , shared .riflClientIdCollision );
2303
2313
return ;
@@ -2307,13 +2317,13 @@ void call(client *c, int flags) {
2307
2317
return ;
2308
2318
}
2309
2319
}
2310
- if (c -> cmd -> proc != selectCommand ) {
2320
+ if (c -> cmd -> proc != selectCommand && c -> cmd -> flags & CMD_WRITE ) {
2311
2321
++ server .currentOpNum ;
2312
2322
}
2313
2323
c -> cmd -> proc (c );
2314
2324
2315
2325
// Track unsynced change.
2316
- if (c -> cmd -> flags & CMD_AT_MOST_ONCE ) {
2326
+ if (c -> cmd -> flags & CMD_AT_MOST_ONCE && server . numWitness > 0 ) {
2317
2327
trackUnsyncedRpc (c );
2318
2328
}
2319
2329
0 commit comments