@@ -1171,24 +1171,34 @@ struct redisCommand *lookupCommandByCString(char *s) {
1171
1171
}
1172
1172
1173
1173
/* Call() is the core of Redis execution of a command */
1174
- void call (redisClient * c ) {
1174
+ void call (redisClient * c , int flags ) {
1175
1175
long long dirty , start = ustime (), duration ;
1176
1176
1177
1177
dirty = server .dirty ;
1178
1178
c -> cmd -> proc (c );
1179
1179
dirty = server .dirty - dirty ;
1180
1180
duration = ustime ()- start ;
1181
- c -> cmd -> microseconds += duration ;
1182
- slowlogPushEntryIfNeeded (c -> argv ,c -> argc ,duration );
1183
- c -> cmd -> calls ++ ;
1184
-
1185
- if (server .aof_state != REDIS_AOF_OFF && dirty > 0 )
1186
- feedAppendOnlyFile (c -> cmd ,c -> db -> id ,c -> argv ,c -> argc );
1187
- if ((dirty > 0 || c -> cmd -> flags & REDIS_CMD_FORCE_REPLICATION ) &&
1188
- listLength (server .slaves ))
1189
- replicationFeedSlaves (server .slaves ,c -> db -> id ,c -> argv ,c -> argc );
1190
- if (listLength (server .monitors ))
1191
- replicationFeedMonitors (server .monitors ,c -> db -> id ,c -> argv ,c -> argc );
1181
+
1182
+ /* When EVAL is called loading the AOF we don't want commands called
1183
+ * from Lua to go into the slowlog or to populate statistics. */
1184
+ if (server .loading && c -> flags & REDIS_LUA_CLIENT )
1185
+ flags &= ~(REDIS_CALL_SLOWLOG | REDIS_CALL_STATS );
1186
+
1187
+ if (flags & REDIS_CALL_SLOWLOG )
1188
+ slowlogPushEntryIfNeeded (c -> argv ,c -> argc ,duration );
1189
+ if (flags & REDIS_CALL_STATS ) {
1190
+ c -> cmd -> microseconds += duration ;
1191
+ c -> cmd -> calls ++ ;
1192
+ }
1193
+ if (flags & REDIS_CALL_PROPAGATE ) {
1194
+ if (server .aof_state != REDIS_AOF_OFF && dirty > 0 )
1195
+ feedAppendOnlyFile (c -> cmd ,c -> db -> id ,c -> argv ,c -> argc );
1196
+ if ((dirty > 0 || c -> cmd -> flags & REDIS_CMD_FORCE_REPLICATION ) &&
1197
+ listLength (server .slaves ))
1198
+ replicationFeedSlaves (server .slaves ,c -> db -> id ,c -> argv ,c -> argc );
1199
+ if (listLength (server .monitors ))
1200
+ replicationFeedMonitors (server .monitors ,c -> db -> id ,c -> argv ,c -> argc );
1201
+ }
1192
1202
server .stat_numcommands ++ ;
1193
1203
}
1194
1204
@@ -1317,7 +1327,7 @@ int processCommand(redisClient *c) {
1317
1327
queueMultiCommand (c );
1318
1328
addReply (c ,shared .queued );
1319
1329
} else {
1320
- call (c );
1330
+ call (c , REDIS_CALL_FULL );
1321
1331
}
1322
1332
return REDIS_OK ;
1323
1333
}
0 commit comments