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] Precalculate expiry timestamp#14625

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

Closed
dosten wants to merge1 commit intosymfony:masterfromdosten:precalculate-expiry-timestamp
Closed

[HttpFoundation] Precalculate expiry timestamp#14625

dosten wants to merge1 commit intosymfony:masterfromdosten:precalculate-expiry-timestamp

Conversation

@dosten
Copy link
Contributor

QA
Bug fix?no
New feature?no
BC breaks?yes
Deprecations?no
Tests pass?yes
Fixed tickets#13955
LicenseMIT
Doc PR-

Copy link
Member

Choose a reason for hiding this comment

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

This would need to be added to the update file.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I've added more info in theUPGRADE-3.0.md file, see above.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can just put0 here since this is only dummy data that will be updated by the write operation later anyway

@dosten
Copy link
ContributorAuthor

@Tobion done

Copy link
Contributor

Choose a reason for hiding this comment

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

This will result in wrong expiry time.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, maybe the steps must be:

  • Create a newsess_expiry column.
  • Migrate the old data:UPDATE session SET sess_expiry = sess_time + sess_lifetime;
  • Remove thesess_time andsess_lifetime columns.

What do you think?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

@dosten
Copy link
ContributorAuthor

@Tobion updated the UPGRADE-3.0.md file.

@Tobion
Copy link
Contributor

👍

@TobionTobion added the Ready labelMay 23, 2015
@Tobion
Copy link
Contributor

ping @symfony/deciders

@xabbuh
Copy link
Member

Can we in a way provide a smoother upgrade path (ie. by offering a deprecation message in Symfony 2.8)?

@weaverryan
Copy link
Member

I agree. I think we should create a new class for this and deprecate the old class. We already messed this up in 2.6 with the newPdoSessionHandler and then had to add theLegacyPdoSessionHandler quickly after to help ease the upgrade path. That - like everything else we do - will give them at least on version where they can migrate from the old to the new. If we did that, this would be merged into 2.8, which again, is consistent with all our other features (no new features inonly 3.0).

@Tobion
Copy link
Contributor

I agree is would be nicer. But how would we name the new PdoSessionHandler? If the name sucks, we have to change the name again in 3.0 which will not make the upgrade easier.

@weaverryan
Copy link
Member

@Tobion ha, so true - we don't want something likeTheNewPdoSessionHandler :).

And I'm really not sure - I think about this question a lot, but I don't know a good, global answer. How aboutPdoExpirySessionHandler in this case? I realize it's a slippery slope (would future changes make an ever-longer name?), but I don't think we can plan for that, and we need some way to introduce this improvement in 2.8 without the BC break.

@GromNaN
Copy link
Member

Is there a necessity of removing thesess_time andsess_lifetime columns ? I don't think so.

Since thissess_expiry column needs to be added for performance reasons on "large production websites", it's a pity that we have to break session databases this way.

For a smoother migration path, I would create a feature flag to enable the extrasess_expiry column.
sess_time andsess_lifetime columns get always filled and you can still enable/disable the feature anytime and re-run the SQL query to populate thesess_expiry column.

@dosten
Copy link
ContributorAuthor

IMO the only factible way to introduce this in 2.8 is the idea proposed by@GromNaN. What do you think? If all agree, i can make the necessary changes.

@weaverryan
Copy link
Member

I think@GromNaN's idea would certainly work, though we'd need to have a lot of if statements inside the class to use different queries. But we could deprecate theold way and remove it in 3.0 (meaning only 1 version would need to have all these ugly if statements). But yea, I would like to fix this - other than the BC part, it sounds like a great win!

@dosten
Copy link
ContributorAuthor

Ok, i will work on this.

@weaverryan
Copy link
Member

@dosten you rock :)

@Tobion
Copy link
Contributor

I think the index on the expiry column is really necessary for high loads:#15020 (comment)

@dosten
Copy link
ContributorAuthor

I'm not a database expert, if someone knows how to create an index in mysql, sqlite, pgsql, oci or sqlsrv.. help is welcome :)

@GromNaN
Copy link
Member

@dosten the syntax is SQL standard :https://dev.mysql.com/doc/refman/5.0/en/create-index.html

CREATEINDEXidx_sess_expiryON session (sess_expiry);

@dosten
Copy link
ContributorAuthor

Closing this because i'm going to create another PR over the 2.8 branch.

@dostendosten closed thisJun 28, 2015
@dostendosten deleted the precalculate-expiry-timestamp branchNovember 7, 2015 03:20
@GuilhemN
Copy link
Contributor

no news about this?

bcremer added a commit to bcremer/symfony that referenced this pull requestJan 26, 2017
Removed timestamp and lifetime columns in favor of expiry column.Based on the work done insymfony#14625.Fixsymfony#13955.
robfrawley pushed a commit to src-run/symfony that referenced this pull requestMar 3, 2017
Removed timestamp and lifetime columns in favor of expiry column.Based on the work done insymfony#14625.Fixsymfony#13955.Implemented CR suggestions from nicolas-grekas
nicolas-grekas added a commit that referenced this pull requestAug 20, 2019
… (azjezz)This PR was merged into the 4.4 branch.Discussion----------[HttpFoundation] Precalculate session expiry timestamp| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets |#13955,#21423,#14625| License       | MITContinued work from the original PR#21423 /#21857Commits-------066000a [HttpFoundation] Precalculate session expiry timestamp
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@dosten@Tobion@xabbuh@weaverryan@GromNaN@GuilhemN

[8]ページ先頭

©2009-2025 Movatter.jp