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

feat: add fieldttl command that returns the ttl of the member #2026

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Conversation

romange
Copy link
Collaborator

@romange romange commented Oct 15, 2023

Currently implemented only for saddex.

@romange romange requested a review from dranikpg October 15, 2023 17:39
dranikpg
dranikpg previously approved these changes Oct 15, 2023
@@ -1495,6 +1536,7 @@ void GenericFamily::Register(CommandRegistry* registry) {
<< CI{"SCAN", CO::READONLY | CO::FAST | CO::LOADING, -2, 0, 0, 0, acl::kScan}.HFUNC(Scan)
<< CI{"TTL", CO::READONLY | CO::FAST, 2, 1, 1, 1, acl::kTTL}.HFUNC(Ttl)
<< CI{"PTTL", CO::READONLY | CO::FAST, 2, 1, 1, 1, acl::kPTTL}.HFUNC(Pttl)
<< CI{"FIELDTTL", CO::READONLY | CO::FAST, 3, 1, 1, 1, acl::kFieldTtl}.HFUNC(FieldTtl)
Copy link
Contributor

@dranikpg dranikpg Oct 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe SetTTL would be a better name? Field doesn't indicate what "command family" it really belongs to

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the whole point. I am going to add transparent support for hash family via the same command

if (!IsValid(it))
return -2;

if (it->second.ObjType() != OBJ_SET) // TODO: to finish for hashes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then we also want to have one command for both set and hset... maybe we can just add two 😄 Either way it your call

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the feature is not yet finished, hence the TODO :)

Currently implemented only for saddex.

Signed-off-by: Roman Gershman <[email protected]>
@romange romange merged commit c6946d5 into main Oct 16, 2023
@romange romange deleted the fieldttl branch October 16, 2023 09:12
azuredream added a commit to azuredream/dragonfly that referenced this pull request Oct 17, 2023
Signed-off-by: azuredream <[email protected]>

fix: evict open connections for users not present in the updated ACL

Signed-off-by: azuredream <[email protected]>

fix: evict open connections for users not present in the updated ACL

Signed-off-by: azuredream <[email protected]>

fix: evict open connections for users not present in the updated ACL

Signed-off-by: azuredream <[email protected]>

fix(server): Don't recompute shard for squashed stub tx (dragonflydb#2017)

Signed-off-by: Vladislav Oleshko <[email protected]>

feat: allow extracting the expiry time from string_set (dragonflydb#2020)

We introduce `iterator Find(member)` function
as well as iterator members to actually get the expiry time.

opt(server): Allow round-robin keys between shards based on prefix (dragonflydb#2016)

This will allow some use cases with few busy keys to distribute load
more evenly between threads.

Idea by @dranikpg.

To calculate how many entries are needed in the table I used the
following quick-n-dirty code, to reach <2.5% collision with 100 keys:

```cpp
bool Distribute(int balls = 100, int bins = 100) {
  vector<int> v(bins);
  for (int i = 0; i < balls; ++i) {
    v[rand() % v.size()]++;
  }

  for (int v : v) {
    if (v >= 2) {
      return true;
    }
  }

  return false;
}

int main(int argc, char** argv) {
  int has_2_balls = 0;
  constexpr int kRounds = 1'000'000;
  for (int i = 0; i < kRounds; ++i) {
    has_2_balls += Distribute(100, 100'000);
  }
  cout << has_2_balls << " rounds had 2+ balls in a single bin out of " << kRounds << endl;
}
```

chore: Enable squashing by default (dragonflydb#2011)

* chore: Enable squashing

fix: reject zset variadic commands with 0 keys (dragonflydb#2022)

Fixes the assertion failure as reported by dragonflydb#1994.

Signed-off-by: Roman Gershman <[email protected]>

fix(server): Start periodic fiber only once init completes (dragonflydb#2023)

chore: remove .DS_Store file (dragonflydb#2025)

fix(server): Fix shardlocal eval with round-robin prefix (dragonflydb#2024)

fix(search): Use double numeric values (dragonflydb#2015)

* fix(search): Use double numeric values

Signed-off-by: Vladislav Oleshko <[email protected]>

---------

Signed-off-by: Vladislav Oleshko <[email protected]>

feat: add fieldttl command that returns the ttl of the member (dragonflydb#2026)

Currently implemented only for saddex.

Signed-off-by: Roman Gershman <[email protected]>

fix(ubuntu-prod): Set suexec hash correctly (dragonflydb#2029)

chore(helm-chart): update to v1.11.0

fix(server): Exclude eval from pipeline squashing (dragonflydb#2027)

* fix(server): Exclude eval from pipeline squashing

Signed-off-by: Vladislav Oleshko <[email protected]>

---------

Signed-off-by: Vladislav Oleshko <[email protected]>

fix: evict open connections for users not present in the updated ACL

Signed-off-by: azuredream <[email protected]>
azuredream pushed a commit to azuredream/dragonfly that referenced this pull request Oct 25, 2023
…flydb#2026)

Currently implemented only for saddex.

Signed-off-by: Roman Gershman <[email protected]>
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.

2 participants