Skip to content

Commit ffac552

Browse files
John SullyGitHub Enterprise
authored andcommitted
Remove Expireset (#217)
Major refactor to place expiry information directly in the object struct.
1 parent 80dcbad commit ffac552

17 files changed

Lines changed: 423 additions & 478 deletions

src/aof.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,8 +1592,7 @@ int rewriteAppendOnlyFileRio(rio *aof) {
15921592
}
15931593
/* Save the expire time */
15941594
if (o->FExpires()) {
1595-
std::unique_lock<fastlock> ul(g_expireLock);
1596-
expireEntry *pexpire = db->getExpire(&key);
1595+
expireEntry *pexpire = &o->expire;
15971596
for (auto &subExpire : *pexpire) {
15981597
if (subExpire.subkey() == nullptr)
15991598
{

src/cluster.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5610,7 +5610,6 @@ void migrateCommand(client *c) {
56105610
/* Create RESTORE payload and generate the protocol to call the command. */
56115611
for (j = 0; j < num_keys; j++) {
56125612
long long ttl = 0;
5613-
std::unique_lock<fastlock> ul(g_expireLock);
56145613
expireEntry *pexpire = c->db->getExpire(kv[j]);
56155614
long long expireat = INVALID_EXPIRE;
56165615
if (pexpire != nullptr)

src/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2908,7 +2908,7 @@ standardConfig configs[] = {
29082908
createIntConfig("list-compress-depth", NULL, MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->list_compress_depth, 0, INTEGER_CONFIG, NULL, NULL),
29092909
createIntConfig("rdb-key-save-delay", NULL, MODIFIABLE_CONFIG, INT_MIN, INT_MAX, g_pserver->rdb_key_save_delay, 0, INTEGER_CONFIG, NULL, NULL),
29102910
createIntConfig("key-load-delay", NULL, MODIFIABLE_CONFIG, INT_MIN, INT_MAX, g_pserver->key_load_delay, 0, INTEGER_CONFIG, NULL, NULL),
2911-
createIntConfig("active-expire-effort", NULL, MODIFIABLE_CONFIG, 1, 10, cserver.active_expire_effort, 1, INTEGER_CONFIG, NULL, NULL), /* From 1 to 10. */
2911+
createIntConfig("active-expire-effort", NULL, MODIFIABLE_CONFIG, 1, 10, g_pserver->active_expire_effort, 1, INTEGER_CONFIG, NULL, NULL), /* From 1 to 10. */
29122912
createIntConfig("hz", NULL, MODIFIABLE_CONFIG, 0, INT_MAX, g_pserver->config_hz, CONFIG_DEFAULT_HZ, INTEGER_CONFIG, NULL, updateHZ),
29132913
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),
29142914
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),

0 commit comments

Comments
 (0)