Skip to content

Commit

Permalink
Remove Expireset (#217)
Browse files Browse the repository at this point in the history
Major refactor to place expiry information directly in the object struct.
  • Loading branch information
John Sully authored and GitHub Enterprise committed Aug 21, 2023
1 parent 80dcbad commit ffac552
Show file tree
Hide file tree
Showing 17 changed files with 423 additions and 478 deletions.
3 changes: 1 addition & 2 deletions src/aof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1592,8 +1592,7 @@ int rewriteAppendOnlyFileRio(rio *aof) {
}
/* Save the expire time */
if (o->FExpires()) {
std::unique_lock<fastlock> ul(g_expireLock);
expireEntry *pexpire = db->getExpire(&key);
expireEntry *pexpire = &o->expire;
for (auto &subExpire : *pexpire) {
if (subExpire.subkey() == nullptr)
{
Expand Down
1 change: 0 additions & 1 deletion src/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5610,7 +5610,6 @@ void migrateCommand(client *c) {
/* Create RESTORE payload and generate the protocol to call the command. */
for (j = 0; j < num_keys; j++) {
long long ttl = 0;
std::unique_lock<fastlock> ul(g_expireLock);
expireEntry *pexpire = c->db->getExpire(kv[j]);
long long expireat = INVALID_EXPIRE;
if (pexpire != nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2908,7 +2908,7 @@ standardConfig configs[] = {
createIntConfig("list-compress-depth", NULL, MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->list_compress_depth, 0, INTEGER_CONFIG, NULL, NULL),
createIntConfig("rdb-key-save-delay", NULL, MODIFIABLE_CONFIG, INT_MIN, INT_MAX, g_pserver->rdb_key_save_delay, 0, INTEGER_CONFIG, NULL, NULL),
createIntConfig("key-load-delay", NULL, MODIFIABLE_CONFIG, INT_MIN, INT_MAX, g_pserver->key_load_delay, 0, INTEGER_CONFIG, NULL, NULL),
createIntConfig("active-expire-effort", NULL, MODIFIABLE_CONFIG, 1, 10, cserver.active_expire_effort, 1, INTEGER_CONFIG, NULL, NULL), /* From 1 to 10. */
createIntConfig("active-expire-effort", NULL, MODIFIABLE_CONFIG, 1, 10, g_pserver->active_expire_effort, 1, INTEGER_CONFIG, NULL, NULL), /* From 1 to 10. */
createIntConfig("hz", NULL, MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->config_hz, CONFIG_DEFAULT_HZ, INTEGER_CONFIG, NULL, updateHZ),
createIntConfig("min-replicas-to-write", "min-slaves-to-write", MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->repl_min_slaves_to_write, 0, INTEGER_CONFIG, NULL, updateGoodSlaves),
createIntConfig("min-replicas-max-lag", "min-slaves-max-lag", MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->repl_min_slaves_max_lag, 10, INTEGER_CONFIG, NULL, updateGoodSlaves),
Expand Down
Loading

0 comments on commit ffac552

Please sign in to comment.