Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add hash expiration - HEXPIRE and family #674

Closed
wants to merge 9 commits into from

Conversation

mmclure-msft
Copy link
Contributor

@mmclure-msft mmclure-msft commented Sep 18, 2024

Redis 7.4 adds the ability to add a per field TTL to hashes through the new HEXPIRE/HPEXPIRE/HEXPIREAT/HPEXPIREAT/HTTL/HPTTL commands. This could heavily reduce the dependency on LUA for users of Redisson MapCache objects since they could use MapCacheNative that use these commands and only a small amount of LUA.

This is a work in progress to try to add this functionality to Garnet.

TODO

  • Figure out why the second time we execute the HEXPIRE command it occurs asynchronously and you get the wrong result back causing simple tests to fail.
  • ACL tests
  • Many more tests
  • Implement HTTL
  • Actually make the TTL expire the field

Instead of TTL store expiration instant

Add first test for HEXPIRE

Implement initial parsing for HEXPIRE and family

Trying to get test to pass
Add entries to RespCommandsInfo.json for HEXPIREAT, HPEXPIRE, HPEXPIREAT
Fix expiration time calculus
@TalZaccai TalZaccai marked this pull request as draft September 19, 2024 16:12
@badrishc
Copy link
Contributor

badrishc commented Nov 25, 2024

@mmclure-msft - there are some requests in open source for HEXPIRE. Do you plan to complete this PR? A lot has changed in command parsing so this might be challenging to rebase to main. If not, perhaps @Vijay-Nirmal, you might be interested in this, starting with HEXPIRE?

@Vijay-Nirmal
Copy link
Contributor

Vijay-Nirmal commented Nov 25, 2024

@badrishc A Lot of ground work has already been done by @mmclure-msft. I don't like the effort put into this PR going to waste. Let's wait for @mmclure-msft response. In the meantime, I am working on other commands.

@badrishc
Copy link
Contributor

@mmclure-msft - let us know what you think, thank you!

@Vijay-Nirmal
Copy link
Contributor

Vijay-Nirmal commented Dec 3, 2024

@badrishc How do you like to handle field deletion/tombstone after the expiration of a field? I am not sure whether can use tombstone logic here. I have messaged you on Discord

@badrishc
Copy link
Contributor

badrishc commented Dec 5, 2024

@badrishc How do you like to handle field deletion/tombstone after the expiration of a field? I am not sure whether can use tombstone logic here. I have messaged you on Discord

I'm not yet sure how exactly to design an efficient HEXPIRE that does not incur space and processing overhead in the common case where there are no expirations needed. This will need a bit of brainstorming.

Hash is a .net object so there is no need to tombstone existing hash entries, just delete them when we encounter them to be expired during a read.

@Vijay-Nirmal
Copy link
Contributor

Vijay-Nirmal commented Dec 5, 2024

Hash is a .net object so there is no need to tombstone existing hash entries, just delete them when we encounter them to be expired during a read.

That's one of the idea I thought of but what if it's not read again? Also, read comments will perform a write operation.

This will need a bit of brainstorming.

Ya, thought of few ideas but I like to have longer conversations about it or like to know how you guys are planning to do this.

@badrishc badrishc mentioned this pull request Dec 6, 2024
@badrishc
Copy link
Contributor

badrishc commented Dec 6, 2024

Closing in favor of a new issue #857

@badrishc badrishc closed this Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants