Skip to content

Commit

Permalink
Remove the DB lock, its unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Oct 25, 2019
1 parent 4396682 commit 631f863
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions src/networking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3003,7 +3003,6 @@ int processEventsWhileBlocked(int iel) {
{
serverAssert(c->flags & CLIENT_PROTECTED);
c->lock.unlock();
c->db->lock.unlock();
}
aeReleaseLock();
while (iterations--) {
Expand All @@ -3017,8 +3016,6 @@ int processEventsWhileBlocked(int iel) {
if (c != nullptr)
c->lock.lock();
locker.arm(c);
if (c != nullptr)
c->db->lock.lock();
locker.release();
return count;
}
Expand Down
1 change: 0 additions & 1 deletion src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3704,7 +3704,6 @@ int processCommand(client *c, int callFlags) {
queueMultiCommand(c);
addReply(c,shared.queued);
} else {
std::unique_lock<decltype(c->db->lock)> ulock(c->db->lock);
call(c,callFlags);
c->woff = g_pserver->master_repl_offset;
if (listLength(g_pserver->ready_keys))
Expand Down
4 changes: 1 addition & 3 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ typedef struct clientReplyBlock {
* database. The database number is the 'id' field in the structure. */
typedef struct redisDb {
redisDb()
: expireitr(nullptr), lock("redisDB")
: expireitr(nullptr)
{};
dict *pdict; /* The keyspace for this DB */
expireset *setexpire;
Expand All @@ -1057,8 +1057,6 @@ typedef struct redisDb {
long long last_expire_set; /* when the last expire was set */
double avg_ttl; /* Average TTL, just for stats */
list *defrag_later; /* List of key names to attempt to defrag one by one, gradually. */

fastlock lock;
} redisDb;

/* Client MULTI/EXEC state */
Expand Down

0 comments on commit 631f863

Please sign in to comment.