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

Make a light weight version of DEBUG OBJECT, add FAST option #881

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

enjoy-binbin
Copy link
Member

@enjoy-binbin enjoy-binbin commented Aug 9, 2024

Adding FAST option to DEBUG OBJECT command.

The light version only shows the light weight infomation,
which mostly O(1). The pre-existing version that show more
stats such as serializedlength sometimes is time consuming.

This should allow looking into debug stats (the key expired
but not deleted), even on huge object, on which we're afraid
to run the command for fear of causing a server freeze.

Like 3ca451c.

The light version only shows the light weight infomation,
which mostly O(1). The pre-existing version that show more
stats such as serializedlength is reachable with the `full`
argument.

This should allow looking into debug stats (the key expired
but not deleted), even on huge object, on which we're afraid
to run the command for fear of causing a server freeze.

Like 3ca451c.

Signed-off-by: Binbin <binloveplay1314@qq.com>
Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.17%. Comparing base (7424620) to head (23fcddd).
Report is 73 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #881      +/-   ##
============================================
- Coverage     70.39%   70.17%   -0.23%     
============================================
  Files           112      112              
  Lines         61465    61496      +31     
============================================
- Hits          43271    43156     -115     
- Misses        18194    18340     +146     
Files with missing lines Coverage Δ
src/debug.c 54.28% <100.00%> (+0.29%) ⬆️

... and 16 files with indirect coverage changes

Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

This is not backward compatible, but we don't need backward compatibility for DEBUG?

@enjoy-binbin
Copy link
Member Author

This is not backward compatible, but we don't need backward compatibility for DEBUG?

yes, it is for debug, i don't think we need backward compatibility for it.

@madolson
Copy link
Member

This is not backward compatible, but we don't need backward compatibility for DEBUG?

Why not make it backward compatible though? I found a few examples of AWS using it internally for testing that would fail on rdbSavedObjectLen(). Those are easy to fix, but maybe someone else is using that as well. We could easily make it backwards compatible and do DEBUG OBJECT FAST no?

@enjoy-binbin
Copy link
Member Author

Why not make it backward compatible though? I found a few examples of AWS using it internally for testing that would fail on rdbSavedObjectLen(). Those are easy to fix, but maybe someone else is using that as well. We could easily make it backwards compatible and do DEBUG OBJECT FAST no?

the default behavior is a bit dangerous, like act on a large lists, but i guess the DEBUG is already dangerous in usually, DEBUG OBJECT FAST looks good to me, i will change it

Signed-off-by: Binbin <binloveplay1314@qq.com>
@enjoy-binbin enjoy-binbin changed the title Make a light weight version (default) of DEBUG OBJECT Make a light weight version of DEBUG OBJECT, add FAST option Aug 14, 2024
Copy link
Member

@madolson madolson left a comment

Choose a reason for hiding this comment

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

Yeah, this seems great to me.

src/debug.c Show resolved Hide resolved
@enjoy-binbin enjoy-binbin merged commit fc9f291 into valkey-io:unstable Aug 16, 2024
47 checks passed
@enjoy-binbin enjoy-binbin deleted the light_debug_object branch August 16, 2024 02:18
mapleFU pushed a commit to mapleFU/valkey that referenced this pull request Aug 21, 2024
…io#881)

Adding FAST option to DEBUG OBJECT command.

The light version only shows the light weight infomation,
which mostly O(1). The pre-existing version that show more
stats such as serializedlength sometimes is time consuming.

This should allow looking into debug stats (the key expired
but not deleted), even on huge object, on which we're afraid
to run the command for fear of causing a server freeze.

Somehow like 3ca451c.

Signed-off-by: Binbin <binloveplay1314@qq.com>
Signed-off-by: mwish <maplewish117@gmail.com>
mapleFU pushed a commit to mapleFU/valkey that referenced this pull request Aug 22, 2024
…io#881)

Adding FAST option to DEBUG OBJECT command.

The light version only shows the light weight infomation,
which mostly O(1). The pre-existing version that show more
stats such as serializedlength sometimes is time consuming.

This should allow looking into debug stats (the key expired
but not deleted), even on huge object, on which we're afraid
to run the command for fear of causing a server freeze.

Somehow like 3ca451c.

Signed-off-by: Binbin <binloveplay1314@qq.com>
Signed-off-by: mwish <maplewish117@gmail.com>
madolson pushed a commit that referenced this pull request Sep 2, 2024
Adding FAST option to DEBUG OBJECT command.

The light version only shows the light weight infomation,
which mostly O(1). The pre-existing version that show more
stats such as serializedlength sometimes is time consuming.

This should allow looking into debug stats (the key expired
but not deleted), even on huge object, on which we're afraid
to run the command for fear of causing a server freeze.

Somehow like 3ca451c.

Signed-off-by: Binbin <binloveplay1314@qq.com>
madolson pushed a commit that referenced this pull request Sep 3, 2024
Adding FAST option to DEBUG OBJECT command.

The light version only shows the light weight infomation,
which mostly O(1). The pre-existing version that show more
stats such as serializedlength sometimes is time consuming.

This should allow looking into debug stats (the key expired
but not deleted), even on huge object, on which we're afraid
to run the command for fear of causing a server freeze.

Somehow like 3ca451c.

Signed-off-by: Binbin <binloveplay1314@qq.com>
@enjoy-binbin enjoy-binbin added the release-notes This issue should get a line item in the release notes label Sep 4, 2024
PingXie added a commit to PingXie/valkey that referenced this pull request Sep 14, 2024
…io#881)

Adding FAST option to DEBUG OBJECT command.

The light version only shows the light weight infomation,
which mostly O(1). The pre-existing version that show more
stats such as serializedlength sometimes is time consuming.

This should allow looking into debug stats (the key expired
but not deleted), even on huge object, on which we're afraid
to run the command for fear of causing a server freeze.

Somehow like 3ca451c.

Signed-off-by: Binbin <binloveplay1314@qq.com>
Signed-off-by: Ping Xie <pingxie@google.com>
PingXie added a commit to PingXie/valkey that referenced this pull request Sep 14, 2024
…io#881)

Adding FAST option to DEBUG OBJECT command.

The light version only shows the light weight infomation,
which mostly O(1). The pre-existing version that show more
stats such as serializedlength sometimes is time consuming.

This should allow looking into debug stats (the key expired
but not deleted), even on huge object, on which we're afraid
to run the command for fear of causing a server freeze.

Somehow like 3ca451c.

Signed-off-by: Binbin <binloveplay1314@qq.com>
Signed-off-by: Ping Xie <pingxie@google.com>
PingXie added a commit to PingXie/valkey that referenced this pull request Sep 14, 2024
…io#881)

Adding FAST option to DEBUG OBJECT command.

The light version only shows the light weight infomation,
which mostly O(1). The pre-existing version that show more
stats such as serializedlength sometimes is time consuming.

This should allow looking into debug stats (the key expired
but not deleted), even on huge object, on which we're afraid
to run the command for fear of causing a server freeze.

Somehow like 3ca451c.

Signed-off-by: Binbin <binloveplay1314@qq.com>
Signed-off-by: Ping Xie <pingxie@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes This issue should get a line item in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants