-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ccl/sqlproxyccl: add an interval poller for private endpoint updates
There is a requirement of automatically disconnecting existing connections if the ACL rules no longer match the connection's state. For the file-based ACLs, we poll every 1 minute, read the file, and check on every single connection. Here, we implement a similar mechanism for private endpoint updates. This is reasonable for now as: 1. Calls to LookupTenant are cached most of the time. 2. This is only applied to existing connections, and a polling interval of 1 minute isn't too bad. 3. We are already iterating all the connections for the other types ACLs That said, this approach isn't efficient and we're limited by the existing design of AccessController. Checking all the connections each time the watch ticks isn't ideal. In fact, we're checking three times here, one for each ACL. The directory cache already knows which tenants were updated through WatchTenants, and we can definitely do better here. A follow up TODO has been added to refactor AccessController in a way that allows updates to be batched. We should also only check connections only for tenants that have been updated. Release note: None
- Loading branch information
1 parent
42caad4
commit 5913539
Showing
3 changed files
with
104 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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 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 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