+/* Propagate expires into slaves and the AOF file.
+ * When a key expires in the master, a DEL operation for this key is sent
+ * to all the slaves and the AOF file if enabled.
+ *
+ * This way the key expiry is centralized in one place, and since both
+ * AOF and the master->slave link guarantee operation ordering, everything
+ * will be consistent even if we allow write operations against expiring
+ * keys. */
+void propagateExpire(redisDb *db, robj *key) {
+ robj *argv[2];
+
+ argv[0] = createStringObject("DEL",3);
+ argv[1] = key;
+ incrRefCount(key);
+
+ if (server.appendonly)
+ feedAppendOnlyFile(server.delCommand,db->id,argv,2);
+ if (listLength(server.slaves))
+ replicationFeedSlaves(server.slaves,db->id,argv,2);
+
+ decrRefCount(argv[0]);
+ decrRefCount(argv[1]);
+}
+