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

EZP-30823: [6.x] Isolated cache during transactions to avoid race condition #2740

Merged
merged 3 commits into from
Sep 24, 2019

Conversation

andrerom
Copy link
Contributor

@andrerom andrerom commented Aug 14, 2019

Question Answer
JIRA issue EZP-30823
Bug/Improvement yes
Target version 6.7+ (see #2749 for 7.x PR)
BC breaks no
Tests pass yes
Doc needed no

Similar to what was done for 2.5.3 (#2703) and followup in #2749, but adapted for Stash:

  • As Stash has "fat Items" need to catch calls to store/clear on the object itself, this part is not relevant for 7.x
  • Route calls to store items to just deferred delete the key instead
  • Make it so that Items with keys that are marked as invalidated gets returned as a "miss" by the system
  • And with that be able to get rid of the need to clear all cache on rollback, we instead just need to wipe out local changes

TODO:

  • Implement feature / fix a bug.
  • Implement tests.
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

@andrerom andrerom requested review from alongosz and webhdx August 14, 2019 00:46
@andrerom andrerom changed the base branch from master to 6.7 August 14, 2019 00:47
@andrerom andrerom force-pushed the stash_transaction_race branch from 55e5bde to e7cdba7 Compare August 14, 2019 00:47
@andrerom
Copy link
Contributor Author

andrerom commented Aug 14, 2019

Tests passing and it also passed scenario defined by @mateuszbieniek on JIRA.

But ideally I'd also like to somehow have better test coverage for this that would be relevant also for 7.5. But a bit unsure how, suggestions welcome.

On that there is actually two things to tests:

  • the race condition, so will have to use separate processes (or some other way of having separate cache pool instance), for instance call some other process before doing a commit
  • within same process/instance checks to see that handlers returns correct expected values, even before we commit all the changes Added a test that tries to verify this

@andrerom andrerom requested a review from adamwojs August 14, 2019 11:19
@andrerom andrerom changed the title EZP-30823: Isolate cache during transactions to avoid race condition EZP-30823: [6.x] Isolate cache during transactions to avoid race condition Aug 26, 2019
@alongosz alongosz changed the title EZP-30823: [6.x] Isolate cache during transactions to avoid race condition EZP-30823: [6.x] Isolated cache during transactions to avoid race condition Aug 30, 2019
Copy link
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

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

Looks almost good, I have some naming/CS concerns mostly.

@andrerom andrerom force-pushed the stash_transaction_race branch from 433a26f to 75549bd Compare August 30, 2019 12:49
@andrerom
Copy link
Contributor Author

@alongosz Updated, thanks for the suggestions 👍

@andrerom andrerom requested review from kmadejski and removed request for kmadejski August 30, 2019 14:14
@lserwatka
Copy link
Member

@micszo we can proceed with QA

@micszo micszo self-assigned this Sep 3, 2019
Copy link
Member

@micszo micszo left a comment

Choose a reason for hiding this comment

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

QA Approved.
Retest successful for Content List block issue and wrong current version issue on eZ Platform EE v1.7.9 with 6.7_race_cond_testing branch. Verified with sanities.
As agreed testing on v1.13.5 will be done post merge.
Testing on v2.5 is ongoing in scope of #2749 / 7.5_race_cond_testing branch.

This is unfortunately not covering need to test cross process issues with this, but
it at least tries to make sure own process recives fresh dfata when it should.
@andrerom andrerom force-pushed the stash_transaction_race branch from 75549bd to f8900bd Compare September 18, 2019 21:13
@micszo
Copy link
Member

micszo commented Sep 20, 2019

@andrerom is it ok if we merge this one as well?

@andrerom

This comment has been minimized.

@andrerom
Copy link
Contributor Author

andrerom commented Sep 23, 2019

@micszo We can merge this once the 2.5 variant of this patch is approved (#2749), you can actually re-test that more easily by just asking for dev-EZP-30823_7.5_transaction_cache_isolation as 7.5.x-dev for kernel directly. Now that the version loading patch has been merged it has been rebased to include that and other changes in the meantime.

If you still experience login issues, then let's do a zoom session as I did not manage to reproduce that.

@andrerom
Copy link
Contributor Author

Merging this up so we can ship this to 1.13LTS reporter on this, to not be blocked by further 2.5LTS testing.

Merge details: I'll wipe out all changes here when merging up to 2.5 (7.5 ), and move changes needed over to the 7.5 PR (tests etc)

@andrerom andrerom merged commit f97c269 into 6.7 Sep 24, 2019
@andrerom andrerom deleted the stash_transaction_race branch September 24, 2019 09:04
@micszo micszo removed their assignment Sep 24, 2019
andrerom added a commit that referenced this pull request Sep 24, 2019
NB! this merge removes all changes done in #2740 as 7.x changes for this is handled seperatly in #2749.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants