[stable21] Prevent duplicate auth token activity updates#29380
Closed
backportbot-nextcloud[bot] wants to merge 1 commit intostable21from
Closed
[stable21] Prevent duplicate auth token activity updates#29380backportbot-nextcloud[bot] wants to merge 1 commit intostable21from
backportbot-nextcloud[bot] wants to merge 1 commit intostable21from
Conversation
skjnldsv
approved these changes
Oct 22, 2021
ChristophWurst
approved these changes
Nov 3, 2021
The auth token activity logic works as follows * Read auth token * Compare last activity time stamp to current time * Update auth token activity if it's older than x seconds This works fine in isolation but with concurrency that means that occasionally the same token is read simultaneously by two processes and both of these processes will trigger an update of the same row. Affectively the second update doesn't add much value. It might set the time stamp to the exact same time stamp or one a few seconds later. But the last activity is no precise science, we don't need this accuracy. This patch changes the UPDATE query to include the expected value in a comparison with the current data. This results in an affected row when the data in the DB still has an old time stamp, but won't affect a row if the time stamp is (nearly) up to date. This is a micro optimization and will possibly not show any significant performance improvement. Yet in setups with a DB cluster it means that the write node has to send fewer changes to the read nodes due to the lower number of actual changes. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
04755a6 to
6ac88b4
Compare
Member
|
Ci says no it seems, restarted |
Member
which job? |
Member
|
is green, but right before final → moved to 21.0.7 |
Closed
nickvergessen
requested changes
Nov 12, 2021
Member
nickvergessen
left a comment
There was a problem hiding this comment.
Needs this follow up too: #29681
szaimen
requested changes
Nov 12, 2021
Contributor
szaimen
left a comment
There was a problem hiding this comment.
This PR should probably get modified to also feature this change
https://github.com/nextcloud/server/pull/29682/files
Member
|
What is the status? Otherwise closing? |
Member
|
@ChristophWurst what's the state with it? Close? |
Member
|
closing |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
backport of #29357