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

feat: add endpoint /v1/session/logout and record client session ID in meta. #16281

Merged
merged 25 commits into from
Aug 22, 2024

Conversation

youngsofun
Copy link
Member

@youngsofun youngsofun commented Aug 19, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  1. support temp table: feat: support temporary table #16250
    1. set client session id to Session so temp table use it as dbname
    2. meta add /<tenant>/<client_session_id> -> {user_name:String} to marking a session is alive, and objects like
      tmptable that lives in the session should not be recycled.
    3. rename global TokenManager to ClientSessionManager
  2. add /v1/session/logout so token and session_id can be remove faster from both mem and meta.
  3. http query polling and final check session_id, otherwise any one knowing the query id and authed can op on and inspect the result that should be private to the session.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Aug 19, 2024
Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

Reviewed 27 of 27 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @youngsofun)


src/query/management/src/client_session.rs line 115 at r1 (raw file):

        let upsert = UpsertPB::update(ident, value)
            .with(seq)
            .with_ttl(Duration::from_secs(ttl.as_secs()));

ttl is already a Duration

Suggestion:

            .with_ttl(ttl);

Copy link
Member Author

@youngsofun youngsofun left a comment

Choose a reason for hiding this comment

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

Reviewable status: 26 of 28 files reviewed, 1 unresolved discussion (waiting on @drmingdrmer)


src/query/management/src/client_session.rs line 115 at r1 (raw file):

Previously, drmingdrmer (张炎泼) wrote…

ttl is already a Duration

Done.

Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dantengsky, @flaneur2020, and @SkyFan2002)

@youngsofun youngsofun requested a review from sundy-li August 20, 2024 12:51
Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

Reviewed 12 of 12 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dantengsky, @flaneur2020, @SkyFan2002, and @sundy-li)

Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dantengsky, @flaneur2020, @SkyFan2002, and @sundy-li)

Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

Reviewed 10 of 10 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dantengsky, @flaneur2020, @SkyFan2002, and @sundy-li)

Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dantengsky, @flaneur2020, @SkyFan2002, and @sundy-li)

@youngsofun youngsofun added this pull request to the merge queue Aug 22, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Aug 22, 2024
@BohuTANG BohuTANG added this pull request to the merge queue Aug 22, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Aug 22, 2024
@BohuTANG BohuTANG merged commit 5f6730a into databendlabs:main Aug 22, 2024
69 of 70 checks passed
@SkyFan2002 SkyFan2002 mentioned this pull request Aug 22, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants