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

fix: remove user specified compaction if the corresponding appenv was removed #814

Merged
merged 4 commits into from
Sep 16, 2021

Conversation

levy5307
Copy link
Contributor

@levy5307 levy5307 commented Sep 16, 2021

What problem does this PR solve?

  1. add some logs
  2. remove user specified compaction if the corresponding appenv was removed
  3. make user specified compaction applicable to default_ttl

Checklist

Tests
  • Manual test (add detailed scripts or steps below)

remove user specified compaction if the corresponding appenv was removed

  1. insert data into app 'temp'
>>> set hashkey sortkey value
OK

app_id          : 2
partition_index : 2
decree          : 36
server          : 10.231.57.100:34803
>>> get hashkey sortkey
"value"

app_id          : 2
partition_index : 2
server          : 10.231.57.100:34803
  1. add user specified compaction
Pegasus-AdminCli-1.1.0 » add-compaction-operation -o delete --hashkey-pattern "hashkey" --hashkey-match "perfix"
  1. start manual compaction
➜  pegasus git:(fix-compaction) ✗ ./scripts/pegasus_manual_compact.sh -c 127.0.0.1:34601,127.0.0.1:34602 -a temp
  1. get data from app 'temp', and we can see the data was deleted
>>> use temp
OK
>>> get hashkey sortkey
Not found

app_id          : 2
partition_index : 2
server          : 10.231.57.100:34803
  1. insert data into app 'temp' again
  2. del appenv for user specified compaction
>>> del_app_envs user_specified_compaction
del app envs succeed
=============================
deleted keys:
    user_specified_compaction
=============================
  1. start manual compaction again
  2. get data from app 'temp', and we can see the data is not deleted
>>> get hashkey sortkey
"value"

app_id          : 2
partition_index : 2
server          : 10.231.57.100:34803

make user specified compaction applicable to default_ttl

  1. insert data into table 'temp'
>>> set hashkey sortkey value
OK

app_id          : 2
partition_index : 2
decree          : 36
server          : 10.231.57.100:34803
>>> get hashkey sortkey
"value"

app_id          : 2
partition_index : 2
server          : 10.231.57.100:34803
  1. set default ttl to 1000
>>> set_app_envs default_ttl 1000
set app envs succeed
  1. set user specified compaction operations
Pegasus-AdminCli-1.1.0 » add-compaction-operation -o delete --start-ttl 10 --stop-ttl 2000
  1. start manual compaction
  2. get data from app 'temp', and we can see data was removed

hycdong
hycdong previously approved these changes Sep 16, 2021
@levy5307 levy5307 merged commit d5976e2 into apache:master Sep 16, 2021
@levy5307 levy5307 deleted the fix-compaction branch September 16, 2021 10:01
This was referenced Sep 22, 2021
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