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

Allow memory malloc-stats and memory purge during loading phase #1317

Open
wants to merge 4 commits into
base: unstable
Choose a base branch
from

Conversation

knggk
Copy link
Contributor

@knggk knggk commented Nov 18, 2024

  • Enable investigation of memory issues during loading
  • Previously, all memory commands were rejected with LOADING error
  • memory malloc-stats and memory purge are now allowed as they don't depend on the dataset
  • memory stats and memory usage key remain disallowed

Signed-off-by: Guillaume Koenig <knggk@amazon.com>
@knggk knggk force-pushed the memory-commands-during-loading branch from 6b826d4 to 09d475d Compare November 18, 2024 22:31
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.76%. Comparing base (aa2dd3e) to head (0c064f3).
Report is 28 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1317      +/-   ##
============================================
+ Coverage     70.73%   70.76%   +0.02%     
============================================
  Files           115      117       +2     
  Lines         63158    63315     +157     
============================================
+ Hits          44674    44802     +128     
- Misses        18484    18513      +29     
Files with missing lines Coverage Δ
src/commands.def 100.00% <ø> (ø)

... and 29 files with indirect coverage changes

@hwware
Copy link
Member

hwware commented Nov 19, 2024

I would like to suggest only 3 commands except "memory stats" to be allowed during loading process because it costs a lot of resources and involves key issues. (key count, key used memory)

@madolson madolson requested a review from hpatro November 22, 2024 03:22
$rd ping

assert_match {Hi Sam, *} [$rd read]
assert_match {*} [$rd read]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we do some partial match of string value here?

Copy link
Contributor Author

@knggk knggk Nov 27, 2024

Choose a reason for hiding this comment

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

Sounds good. I am now matching on *alloc*. It matches both Stats not supported for the current allocator when on Mac, and the actually jemalloc output of interest when on Linux.

Comment on lines 27 to 34
assert_match {Hi Sam, *} [$rd read]
assert_match {*} [$rd read]
assert_match {peak.allocated *} [$rd read]
assert_match {{MEMORY <subcommand> *}} [$rd read]
# Memory usage keeps getting rejected in loading because the dataset is not visible
assert_error {*LOADING*} {$rd read}
assert_match OK [$rd read]
assert_error {*LOADING*} {$rd read}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add comment of the actual command above the response, would be easier to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, have updated as per your recommendation.

Signed-off-by: Guillaume Koenig <knggk@amazon.com>
Copy link
Member

@enjoy-binbin enjoy-binbin left a comment

Choose a reason for hiding this comment

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

LGTM, somehow i think we can put the test in introspection.tcl

@@ -0,0 +1,42 @@
start_server [list overrides [list "key-load-delay" 50 loading-process-events-interval-bytes 1024]] {
Copy link
Member

Choose a reason for hiding this comment

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

The test is failing, i guess we may need a external skip flag.

Suggested change
start_server [list overrides [list "key-load-delay" 50 loading-process-events-interval-bytes 1024]] {
start_server [list overrides [list "key-load-delay" 50 loading-process-events-interval-bytes 1024] tags [list "external:skip"]] {

Copy link
Member

Choose a reason for hiding this comment

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

i commited it so that we can see if the CI will be happy or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like CI is still unhappy but on unrelated tests?

@enjoy-binbin
Copy link
Member

please also update the top comment, we can copy the issue content instead of just linking it.

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 Nov 27, 2024
@knggk knggk changed the title Memory inspection commands no longer return loading errors Allow memory malloc-stats during loading Nov 28, 2024
@knggk knggk changed the title Allow memory malloc-stats during loading Allow memory malloc-stats and memory purge during loading phase Nov 28, 2024
@knggk
Copy link
Contributor Author

knggk commented Nov 28, 2024

please also update the top comment, we can copy the issue content instead of just linking it.

I updated the title and top comment.

Signed-off-by: Guillaume Koenig <knggk@amazon.com>
@knggk
Copy link
Contributor Author

knggk commented Nov 28, 2024

LGTM, somehow i think we can put the test in introspection.tcl

Moved the test into introspection.tcl. Let's see if it passes on the CI.

@enjoy-binbin
Copy link
Member

#1368 The expire test is fixed

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
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants