@@ -2012,23 +2012,24 @@ void deleteExpiredKeyAndPropagate(redisDb *db, robj *keyobj) {
2012
2012
server .stat_expiredkeys ++ ;
2013
2013
}
2014
2014
2015
- /* Propagate expires into slaves and the AOF file.
2016
- * When a key expires in the master, a DEL operation for this key is sent
2017
- * to all the slaves and the AOF file if enabled.
2018
- *
2019
- * This way the key expiry is centralized in one place, and since both
2020
- * AOF and the master->slave link guarantee operation ordering, everything
2021
- * will be consistent even if we allow write operations against expiring
2015
+ /* Propagate an implicit key deletion into replicas and the AOF file.
2016
+ * When a key was deleted in the master by eviction, expiration or a similar
2017
+ * mechanism a DEL/UNLINK operation for this key is sent
2018
+ * to all the replicas and the AOF file if enabled.
2019
+ *
2020
+ * This way the key deletion is centralized in one place, and since both
2021
+ * AOF and the replication link guarantee operation ordering, everything
2022
+ * will be consistent even if we allow write operations against deleted
2022
2023
* keys.
2023
2024
*
2024
2025
* This function may be called from:
2025
2026
* 1. Within call(): Example: Lazy-expire on key access.
2026
2027
* In this case the caller doesn't have to do anything
2027
2028
* because call() handles server.also_propagate(); or
2028
- * 2. Outside of call(): Example: Active-expire, eviction.
2029
+ * 2. Outside of call(): Example: Active-expire, eviction, slot ownership changed .
2029
2030
* In this the caller must remember to call
2030
2031
* postExecutionUnitOperations, preferably just after a
2031
- * single deletion batch, so that DELs will NOT be wrapped
2032
+ * single deletion batch, so that DEL/UNLINK will NOT be wrapped
2032
2033
* in MULTI/EXEC */
2033
2034
void propagateDeletion (redisDb * db , robj * key , int lazy ) {
2034
2035
robj * argv [2 ];
@@ -2038,7 +2039,7 @@ void propagateDeletion(redisDb *db, robj *key, int lazy) {
2038
2039
incrRefCount (argv [0 ]);
2039
2040
incrRefCount (argv [1 ]);
2040
2041
2041
- /* If the master decided to expire a key we must propagate it to replicas no matter what. .
2042
+ /* If the master decided to delete a key we must propagate it to replicas no matter what.
2042
2043
* Even if module executed a command without asking for propagation. */
2043
2044
int prev_replication_allowed = server .replication_allowed ;
2044
2045
server .replication_allowed = 1 ;
0 commit comments