Contribute Threadsave#15
Conversation
12bb64b to
0208ae0
Compare
| } | ||
|
|
||
| int isSaveInProgress(void) { | ||
| return server.rdb_child_type != RDB_CHILD_TYPE_NONE; |
There was a problem hiding this comment.
@JimB123 - I took this from EC but am wondering whether we should rethink this. If threadsave is running, server.child_type is NONE, which I feel should imply server.rdb_child_type should also be NONE. But it is actually set to DISK/SOCKET in this case.
There was a problem hiding this comment.
The current state is a little confusing as we have multiple checks around the code such as:
isSaveInProgress()- checks server.rdb_child_type - disk or socket- checking
server.rdb_child_typedirectly hasActiveChildProcess()- works on all types of rdb child (such as RDB, AOF, ...)server.child_type == CHILD_TYPE_RDB- is specifically a fork bgsave running?server.cur_bgsave_type
So I'm thinking whether this can be a good opportunity to clean this up.
I'm thinking no direct checks on server vars - only function calls such as
isThreadBgsaveInProgress(){
...
}
isForkBgsaveInProgress(){
...
}
isBgsaveInProgress(){
return isThreadBgsaveInProgress() || isForkBgsaveInProgress()
}
isDiskBasedSaveInProgress(){
return server.rdb_child_type == TYPE_DISK
}
hasActiveChildProcess(){
return server.child_pid != -1
}
...
...
also rename rdb_child_type to something like rdb_save_target
There was a problem hiding this comment.
I agree that some cleanup may be warranted. The code you're looking at is very old.
Amzsave (before my time) may have overloaded some of the OSS variables. Threadsave just tried to maintain compatibility with Amzsave.
A concern I'd have about renaming things is that if these show in INFO - it's considered a breaking change. And if you rename the variable internally, but show it in INFO with the old (compatible) change, it may be confusing.
I think you have a lot of latitude in changing threadsave - but less latitude in changing the OSS INFO fields.
There was a problem hiding this comment.
Done. In the last few commits
67a6c6b to
c6f529b
Compare
4aec5e0 to
885d2aa
Compare
…g bgsave and abort it if needed
…ation, test_store_key_deletion_by_georadius
…r) (valkey-io#3349) This is pre-submission into the `forkless-pre-bgiterator` branch for client blocking mechanism. The actual PR review for this is here: valkey-io#3341 Submitting to this branch to enable PR review for bgIterator. Signed-off-by: harrylin98 <harrylin980107@gmail.com>
…ll be overriden by the one saved when valkey is killed
eed090e to
8e0a9f5
Compare
No description provided.