-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix in-place save for DefaultSessionResumptionStorage (#23062)
Nodes that already exist in the DefaultSessionResumptionStorage index are consuming additional entries in the index on save, and aren't cleaned from the link and state tables first. This has the following consequences: 1. If session resumption storage is full, this causes unnecessary eviction of records for other nodes. 2. This pulls the index out of sync from the backing state table because duplicate entries in the index for a given node only map to a single node-id-keyed entry in the state table. 3. An entry in the link table is leaked on each occurrence, as the resumption-id-keyed link entry will be orphaned once its associated state table entry is overwritten. A symptom of this can be seen in the DeleteAll(FabricIndex fabricIndex) method, which will often log errors due to the index being out of sync form the state table. This commit fixes the problem by first deleting the link table entry before saving a record for a node that already exists in the table. Save is also simplified in this case by not rewriting the index, as the node is already in the index. To prevent future problems, unit test code has been added for DefaultSessionResumptionStorage to verify that DeleteAll is completing without errors and that no link or state table entries are leaked.
- Loading branch information
1 parent
d29a6a7
commit 1570114
Showing
3 changed files
with
256 additions
and
22 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