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

only update session in mysql database when required #14540

Merged
merged 1 commit into from Dec 31, 2018

Conversation

Projects
None yet
5 participants
@DanCech
Copy link
Member

commented Dec 17, 2018

This is a small update to help address issues with the mysql session store while we re-architect the session system.

It keeps track of whether the session data has been modified, and only issues an update to the database if the data has been modified or the expiry value is more than 60s old.

My testing indicates that this will reduce the number of UPDATE queries sent to the database quite substantially.

@DanCech DanCech requested review from daniellee and marefr Dec 17, 2018

@bergquist
Copy link
Contributor

left a comment

Tested locally and it works as expected. 👍

I don't understand why we didn't think about this before.

@marefr
Copy link
Member

left a comment

Very minor comments. A few tests of the Release() logic would be great.

Show resolved Hide resolved pkg/services/session/mysql.go Outdated
Show resolved Hide resolved pkg/services/session/mysql.go Outdated

@DanCech DanCech force-pushed the session-skip-update branch from b0c580c to 3f85901 Dec 18, 2018

@torkelo

This comment has been minimized.

Copy link
Member

commented Dec 19, 2018

looks good, are we confident enough to include this in v5.4.3?

@DanCech

This comment has been minimized.

Copy link
Member Author

commented Dec 20, 2018

I feel confident, @cinaglia came up with an almost identical patch independently which is encouraging.

In our discussion we did notice that there isn't any checking of expiry in queryExists or Read, so it's completely dependent on the cleanup job to remove expired sessions. That's something we should address also, but I won't want to muddy the waters by including it in this commit.

@torkelo torkelo added this to the 5.4.3 milestone Dec 20, 2018

@bergquist

This comment has been minimized.

Copy link
Contributor

commented Dec 28, 2018

Will we deploy this before the new session implementation? Otherwise, I think we should avoid introducing changes to the session management.

@torkelo

This comment has been minimized.

Copy link
Member

commented Dec 28, 2018

Well this could be included in patch release soon, new session management won’t be in stable until late February

@DanCech DanCech merged commit efa738d into master Dec 31, 2018

2 checks passed

build-branches-and-prs Workflow: build-branches-and-prs
Details
license/cla Contributor License Agreement is signed.
Details
@DanCech

This comment has been minimized.

Copy link
Member Author

commented Dec 31, 2018

Not sure of the process to cherry-pick it for the patch release

@bergquist

This comment has been minimized.

Copy link
Contributor

commented Jan 8, 2019

Whoever cuts the patch release will cherry-pick all PR's labeled with cherry-pick needed

@bergquist bergquist deleted the session-skip-update branch Jan 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.