Repository navigation
Unlock cluster config file upon server shutdown - #10912
Conversation
|
Your PR only works when Redis exits normally. But when Regarding @redis/core-team Please share your opinion. |
|
@yangbodong22011 to make sure I understand. You are suggesting we remove all of the locking code for nodes.conf? |
|
@yangbodong22011 I don't think we should remove Yes this CR only handles the graceful shutdown, which should happen in almost all of the cases (i.e. by sending a |
|
I'm inclined to agree with qu that this is a reasonable improvement. |
oranagra
left a comment
There was a problem hiding this comment.
@yangbodong22011 if this feature was set in place to protect against misuse, why remove it now?
seems like a reasonable improvement (note that we also explicitly close the listen sockets for exactly the same reason.
|
Here are my reasons for removing
After reading everyone's replies, I think |
|
Unfortunately, the flock() breaks compilation of redis-7.x on Solaris 11.4 (SRU 49). Shouldn't using fcntl() instead of flock() make the code compatible with more Unix-like operating systems - or would it introduce other compatibility issues? |
|
@steffen-moser can you submit a PR to fix that? |
) SunOS/Solaris and its relatives don't support the flock() function. While "redis" has been excluding setting up the lock using flock() on the cluster configuration file when compiling under Solaris, it was still using flock() in the unlock call while shutting down. This pull request eliminates the flock() call also in the unlocking stage for Oracle Solaris and its relatives. Fix compilation regression from #10912
) SunOS/Solaris and its relatives don't support the flock() function. While "redis" has been excluding setting up the lock using flock() on the cluster configuration file when compiling under Solaris, it was still using flock() in the unlock call while shutting down. This pull request eliminates the flock() call also in the unlocking stage for Oracle Solaris and its relatives. Fix compilation regression from #10912 (cherry picked from commit 6aab4cb)
…is#11327) SunOS/Solaris and its relatives don't support the flock() function. While "redis" has been excluding setting up the lock using flock() on the cluster configuration file when compiling under Solaris, it was still using flock() in the unlock call while shutting down. This pull request eliminates the flock() call also in the unlocking stage for Oracle Solaris and its relatives. Fix compilation regression from redis#10912
Currently in cluster mode, Redis process locks the cluster config file when starting up and holds the lock for the entire lifetime of the process. When the server shuts down, it doesn't explicitly release the lock on the cluster config file. We noticed a problem with restart testing that if you shut down a very large redis-server process (i.e. with several hundred GB of data stored), it takes the OS a while to free the resources and unlock the cluster config file. So if we immediately try to restart the redis server process, it might fail to acquire the lock on the cluster config file and fail to come up. This fix explicitly releases the lock on the cluster config file upon a shutdown rather than relying on the OS to release the lock, which is a cleaner and safer approach to free up resources acquired.
…is#11327) SunOS/Solaris and its relatives don't support the flock() function. While "redis" has been excluding setting up the lock using flock() on the cluster configuration file when compiling under Solaris, it was still using flock() in the unlock call while shutting down. This pull request eliminates the flock() call also in the unlocking stage for Oracle Solaris and its relatives. Fix compilation regression from redis#10912
Currently in cluster mode, Redis process locks the cluster config file when starting up and holds the lock for the entire lifetime of the process. When the server shuts down, it doesn't explicitly release the lock on the cluster config file. We noticed a problem with restart testing that if you shut down a very large redis-server process (i.e. with several hundred GB of data stored), it takes the OS a while to free the resources and unlock the cluster config file. So if we immediately try to restart the redis server process, it might fail to acquire the lock on the cluster config file and fail to come up.
This fix explicitly releases the lock on the cluster config file upon a shutdown rather than relying on the OS to release the lock, which is a cleaner and safer approach to free up resources acquired.