Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpFoundation] Added a migrating session handler#26096

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@rossmotley
Copy link
Contributor

@rossmotleyrossmotley commentedFeb 8, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PRsymfony/symfony-docs#9496
  • gather feedback for my changes
  • submit changes to the documentation
  • update the changelog

When migrating to a new session handler on a live system, it's useful to be able to do it with no loss of session data. This migrating handler allows the sessions to be written to an additional handler to enable a migration workflow like:

  • Switch to migrating handler, with your new handler as the 'write only' one. The old handler behaves as usual and sessions get written to the new one.
  • After verifying the data in the new handler (and after the session gc period), switch the migrating handler to use your old handler as the 'write only' one instead, so the sessions will now be read from the new handler. This step allows easier rollbacks.
  • After verifying everything, switch from the migrating handler to the new handler

linaori, donatas-jasinevicius, joshlopes, peter-gribanov, and FractalizeR reacted with thumbs up emoji
@Tobion
Copy link
Contributor

This sounds interesting. But this will only migrate sessions that are accessed. How do you deal with session data from currently inactive users? I guess you still need to manually transfer the data from the old storage to the new one for those. Or you just let them expire after the migration phase.

@rossmotley
Copy link
ContributorAuthor

Hi@Tobion, we leave the migrating handler running for at least the session garbage collection period, as any sessions which have not been written to during that time are considered stale and may be removed by the session handlers themselves.

@nicolas-grekas
Copy link
Member

@rossmotley is this PR ready on your side?

@rossmotley
Copy link
ContributorAuthor

@nicolas-grekas If there isn't anything to change with the code, then I think it's just adding something to the changelog and documentation. Should the changelog changes be added to this PR?

@nicolas-grekas
Copy link
Member

The changelog of the component yes (not the root changelog as it is autogenerated)
If you could start a documentation PR, that'd be awesome.
ping@Tobion if you have some time for the review

@rossmotleyrossmotleyforce-pushed theadd-migrating-session-handler branch 3 times, most recently from68bbd0e to8ec1f99CompareMarch 26, 2018 09:27
@rossmotleyrossmotley changed the title[HttpFoundation] [WIP] Added a migrating session handler[HttpFoundation] Added a migrating session handlerMar 26, 2018
@rossmotleyrossmotleyforce-pushed theadd-migrating-session-handler branch from8ec1f99 to20af2bdCompareMarch 26, 2018 12:11
Copy link
Contributor

@TobionTobion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Some CS error but otherwise looks ok

@rossmotley
Copy link
ContributorAuthor

@Tobion I have made the requested changes

@fabpotfabpotforce-pushed theadd-migrating-session-handler branch fromfb124b1 to3acd548CompareApril 6, 2018 05:59
@fabpot
Copy link
Member

Thank you@rossmotley.

@fabpotfabpot merged commit3acd548 intosymfony:masterApr 6, 2018
fabpot added a commit that referenced this pull requestApr 6, 2018
…ssmotley)This PR was squashed before being merged into the 4.1-dev branch (closes#26096).Discussion----------[HttpFoundation] Added a migrating session handler| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |symfony/symfony-docs#9496- [x] gather feedback for my changes- [x] submit changes to the documentation- [x] update the changelogWhen migrating to a new session handler on a live system, it's useful to be able to do it with no loss of session data. This migrating handler allows the sessions to be written to an additional handler to enable a migration workflow like:* Switch to migrating handler, with your new handler as the 'write only' one. The old handler behaves as usual and sessions get written to the new one.* After verifying the data in the new handler (and after the session gc period), switch the migrating handler to use your old handler as the 'write only' one instead, so the sessions will now be read from the new handler. This step allows easier rollbacks.* After verifying everything, switch from the migrating handler to the new handlerCommits-------3acd548 [HttpFoundation] Added a migrating session handler
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedApr 6, 2018
edited
Loading

We forgot implementingSessionUpdateTimestampHandlerInterface. Fixed in#26828.

Tobion added a commit that referenced this pull requestApr 7, 2018
…SessionUpdateTimestampHandlerInterface (nicolas-grekas)This PR was merged into the 4.1-dev branch.Discussion----------[HttpFoundation] Have MigratingSessionHandler implement SessionUpdateTimestampHandlerInterface| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -Forgotten in#26096Commits-------5d7117b [HttpFoundation] Have MigratingSessionHandler implement SessionUpdateTimestampHandlerInterface
@fabpotfabpot mentioned this pull requestMay 7, 2018
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestMay 24, 2018
…uiluz)This PR was merged into the 4.1 branch.Discussion----------Adding MigratingSessionHandler docsAdding `MigratingSessionHandler` documentation forsymfony/symfony#26096Commits-------e93756f Added the versionadded directive386f639 Reworded and simplified7c8264d Update session_configuration.rste971074 Update session_configuration.rst91aa58d Adding MigratingSessionHandler docs
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

+3 more reviewers

@TobionTobionTobion requested changes

@joshlopesjoshlopesjoshlopes approved these changes

@20uf20uf20uf approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

7 participants

@rossmotley@Tobion@nicolas-grekas@fabpot@joshlopes@20uf@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp