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

[Feature] Kill sessions #5146

Merged
merged 9 commits into from
Dec 30, 2022
Merged

[Feature] Kill sessions #5146

merged 9 commits into from
Dec 30, 2022

Conversation

Aiee
Copy link
Contributor

@Aiee Aiee commented Dec 28, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Close #4747

Description:

Add KILL SESSION command to allow the user to release sessions manually.

Usage:

// Find sessions to be killed
SHOW SESSIONS | YIELD $-.SessionId AS sid WHERE $-.CreateTime < datetime("2022-12-14T18:00:00")
+------------------+
| sid              |
+------------------+
| 1671008607174256 |
| 1671009943733869 |
| 1670997649992274 |
+------------------+

// Kill a single session using session id
KILL SESSION 1671008607174256

// Kill multiple sessions
SHOW SESSIONS
| YIELD $-.SessionId AS sid WHERE $-.CreateTime < datetime("2022-12-14T18:00:00")
| KILL SESSION $-.sid

SHOW SESSIONS
| YIELD $-.SessionId AS sid, $-.CreateTime as CreateTime
| ORDER BY  $-.CreateTime
| KILL SESSION $-.sid

How do you solve it?

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

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • TCK
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the 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:

ex. Fixed the bug .....

@Aiee Aiee added do not review PR: not ready for the code review yet ready-for-testing PR: ready for the CI test doc affected PR: improvements or additions to documentation type/feature req Type: feature request labels Dec 28, 2022
@Aiee Aiee requested review from dutor, codesigner and a team as code owners December 28, 2022 12:50
@xtcyclist xtcyclist removed the do not review PR: not ready for the code review yet label Dec 29, 2022
Update parser
Tune case

Refactor removeSessionFromLocalCache()

Add more tests
@Aiee Aiee requested a review from jievince December 29, 2022 17:20
@abby-cyber abby-cyber self-assigned this Dec 30, 2022
@Aiee Aiee requested a review from Shylock-Hg December 30, 2022 04:00
Copy link
Contributor

@jievince jievince 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!

@Sophie-Xie Sophie-Xie merged commit 51ff615 into vesoft-inc:master Dec 30, 2022
@Aiee Aiee deleted the kill-session branch December 30, 2022 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc affected PR: improvements or additions to documentation ready for review ready-for-testing PR: ready for the CI test type/feature req Type: feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a command to release useless sessions manually
7 participants