"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/db.c" between
redis-6.2-rc3.tar.gz and redis-6.2.0.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

db.c  (redis-6.2-rc3):db.c  (redis-6.2.0)
skipping to change at line 109 skipping to change at line 109
* *
* Note: this function also returns NULL if the key is logically expired * Note: this function also returns NULL if the key is logically expired
* but still existing, in case this is a slave, since this API is called only * but still existing, in case this is a slave, since this API is called only
* for read operations. Even if the key expiry is master-driven, we can * for read operations. Even if the key expiry is master-driven, we can
* correctly report a key is expired on slaves even if the master is lagging * correctly report a key is expired on slaves even if the master is lagging
* expiring our key via DELs in the replication link. */ * expiring our key via DELs in the replication link. */
robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) { robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) {
robj *val; robj *val;
if (expireIfNeeded(db,key) == 1) { if (expireIfNeeded(db,key) == 1) {
/* Key expired. If we are in the context of a master, expireIfNeeded() /* If we are in the context of a master, expireIfNeeded() returns 1
* returns 0 only when the key does not exist at all, so it's safe * when the key is no longer valid, so we can return NULL ASAP. */
* to return NULL ASAP. */
if (server.masterhost == NULL) if (server.masterhost == NULL)
goto keymiss; goto keymiss;
/* However if we are in the context of a slave, expireIfNeeded() will /* However if we are in the context of a slave, expireIfNeeded() will
* not really try to expire the key, it only returns information * not really try to expire the key, it only returns information
* about the "logical" status of the key: key expiring is up to the * about the "logical" status of the key: key expiring is up to the
* master in order to have a consistent view of master's data set. * master in order to have a consistent view of master's data set.
* *
* However, if the command caller is not the master, and as additional * However, if the command caller is not the master, and as additional
* safety measure, the command invoked is a read-only command, we can * safety measure, the command invoked is a read-only command, we can
 End of changes. 1 change blocks. 
3 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)