-
-
Notifications
You must be signed in to change notification settings - Fork 172
Checkpoint(ClientInfo) Caching System #1424
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
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5903d4c
Checkpoint(ClientInfo) Caching System
mnnseong b0fd6c8
concurrency bug fix
mnnseong b5c2e87
resolve linter errors
mnnseong 06ecf54
Refactor cache structure and add state caching
mnnseong a6a79e4
Refactor metadata upsert logic and enable cleanup
mnnseong d8b6aa5
write-through client state with CAS
mnnseong 93a65db
Merge branch 'main' into cp-caching
mnnseong 5cce717
Revise code with coderabbit
mnnseong 8002813
Implement TTL & Routing Test
mnnseong a3dc337
Resolve linter error
mnnseong 3d5046e
adjust TTL and flush interval
mnnseong bd40e7b
Resolve data race
mnnseong 6e420fd
trigger CI
mnnseong 0482f5f
Revise Code
mnnseong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Clarify contract and align semantics across backends for housekeeping deactivation
Right now, Mongo returns (nil, nil) when the client is not found or already deactivated, while the memory backend can return a non-nil ClientInfo in the "already deactivated" case. Please document the intended contract here and align implementations accordingly.
I recommend standardizing on: return (nil, nil) if the client does not exist, belongs to another project, or is already deactivated. This enables callers (e.g., housekeeping) to treat nil as "no-op" consistently.
Apply this comment update to make the contract explicit:
🏁 Script executed:
Length of output: 2279
🏁 Script executed:
Length of output: 6175
Clarify DeactivateClientForHousekeeping contract and align semantics across backends
The memory backend still returns a non-nil
ClientInfowhen the client is already deactivated, whereas the Mongo backend returns(nil, nil)in that case. Let’s standardize on returning(nil, nil)whenever no state change is needed (client not found, wrong project, or already deactivated).• server/backend/database/database.go (interface): update doc comment
• server/backend/database/memory/database.go: change the “already deactivated” branch to return
nil, nilSuggested doc-comment diff in
database.go:Then, in
memory/database.go, replace:with:
🤖 Prompt for AI Agents