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

add LogMonitor to check log disk freeBytes and change log level when space is almost full #3576

Merged
merged 4 commits into from
Jan 10, 2022

Conversation

Nivras
Copy link
Contributor

@Nivras Nivras commented Dec 28, 2021

What type of PR is this?

  • bug
  • feature
  • enhancement

What does this PR do?

add LogMonitor to check log disk freeBytes and change log level when space is almost full

in default config, if log disk free space is less than 256M, change log level to WARNING, and if space less than 64M, change log level to DEBUG, and less than 4M, change log level to FATAL.

If log disk space is bigger than those flag, and log level have changed before(maybe someone clean the log), LogMonitor will change the log level to the old value(which in config file).

Which issue(s)/PR(s) this PR relates to?

#3423

Special notes for your reviewer, ex. impact of this fix, etc:

Additional context/ Design document:

Checklist:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the corresponding label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

                                                            `

Copy link
Contributor

@critical27 critical27 left a comment

Choose a reason for hiding this comment

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

Good job, generally LGTM, maybe you could move to common directory.

src/storage/LogMonitor.cpp Outdated Show resolved Hide resolved
critical27
critical27 previously approved these changes Dec 30, 2021
Copy link
Contributor

@critical27 critical27 left a comment

Choose a reason for hiding this comment

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

Well done~~

@critical27
Copy link
Contributor

Close #3423

@Sophie-Xie Sophie-Xie added the cherry-pick-v3.0 PR: need cherry-pick to this version label Jan 4, 2022
@Sophie-Xie Sophie-Xie linked an issue Jan 4, 2022 that may be closed by this pull request
liuyu85cn
liuyu85cn previously approved these changes Jan 5, 2022
void LogMonitor::checkAndChangeLogLevel() {
getLogDiskFreeByte();

if (FLAGS_log_min_reserved_bytes_to_fatal > FLAGS_log_min_reserved_bytes_to_error ||
Copy link
Contributor

Choose a reason for hiding this comment

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

I think !(FLAGS_log_min_reserved_bytes_to_fatal > FLAGS_log_min_reserved_bytes_to_warn && FLAGS_log_min_reserved_bytes_to_error > FLAGS_log_min_reserved_bytes_to_fatal) is more readable ?

@critical27 critical27 merged commit 83886a0 into vesoft-inc:master Jan 10, 2022
Sophie-Xie pushed a commit that referenced this pull request Jan 15, 2022
…space is almost full (#3576)

* add LogMonitor to check the log disk is full

* fix comments

* add comments for default flags

Co-authored-by: yaphet <4414314+darionyaphet@users.noreply.github.com>
CPWstatic added a commit that referenced this pull request Jan 17, 2022
* add LogMonitor to check log disk freeBytes and change log level when space is almost full (#3576)

* add LogMonitor to check the log disk is full

* fix comments

* add comments for default flags

Co-authored-by: yaphet <4414314+darionyaphet@users.noreply.github.com>

* Ldbc test cases. (#3537)

* Add ldbc test/

* Add all cases.

* Fix some test cases.

* Fix ldbc cases.

* Fix pytest.

Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com>

* fix issue 3675 (#3678)

* Fix expression rewrite (#3614)

* Do not transfer the filter expression if it contains 2 lableAttribute exprs

* Fix expression overflow check

* Fix rewriteRelExpr

* Refactor rewriteRelExpr

* Fix log usage

* Check whether the minus expression contains string

* Add tck cases

* Address comments

* Fix conflicts

* Address comments

* modify metrics in conf files

* Address comments

* fix divide zone should be failed if two zones use the same host (#3699)

* Support more check about merge zone arguments (#3703)

* fix match index (#3694)

* check scheam

* add test case

* fix graph crash

* address comment'
'

* add test case

* fix error

* fix vid select error

* fix unit test error

* address comment

* fix issue 3601 (#3666)

Co-authored-by: Nivras <12605142+Nivras@users.noreply.github.com>
Co-authored-by: yaphet <4414314+darionyaphet@users.noreply.github.com>
Co-authored-by: cpw <13495049+CPWstatic@users.noreply.github.com>
Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com>
Co-authored-by: Yichen Wang <18348405+Aiee@users.noreply.github.com>
Co-authored-by: jimingquan <mingquan.ji@vesoft.com>
Co-authored-by: hs.zhang <22708345+cangfengzhs@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-v3.0 PR: need cherry-pick to this version ready for review ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When the disk is almost full, the storage will crash
6 participants