Skip to content

GroupedSelection: Rows are refetched when cache is invalid [Closes #15] - #59

Open
hranicka wants to merge 3 commits into
nette:masterfrom
hranicka:master
Open

GroupedSelection: Rows are refetched when cache is invalid [Closes #15]#59
hranicka wants to merge 3 commits into
nette:masterfrom
hranicka:master

Conversation

@hranicka

Copy link
Copy Markdown
Contributor

See #15

Currently we use something like this patch in projects and it seems fine.

GroupedSelection::execute refetches data only when isset($this->refCacheCurrent['data']) === TRUE but sometimes this cache is empty and $this->rows === NULL
-> I get errors described in #15

With this patch, it's OK.

I consider this code only as temporary fix. I don't know NDB too much.

@dg

dg commented Mar 26, 2015

Copy link
Copy Markdown
Member

Tests are failing…

@hranicka

Copy link
Copy Markdown
Contributor Author

I think that problem #15 is implementation of Selection::execute & GroupedSelection::execute which fails when cache is invalid.

But I still cannot find the reason why sometimes cache is not valid. Problem occurs SOMETIMES after deployment & cache clean-up & $this->rows === NULL. See #15.

I've made the simpliest change now in GroupedSelection::execute. But previous tests mocked insufficient cache and it made more database queries than expected before the change.

I can't write tests for invalid cache. When I fixed the problem, previous tests with storage mock failed.
It's more complex problem than I can resolve atm (my knowledges of internals of NDTB are poor).

@dg

dg commented Mar 26, 2015

Copy link
Copy Markdown
Member

My knowledge in poor too, I'll try to understand it, but it will not be soon…

@hranicka

Copy link
Copy Markdown
Contributor Author

Can someone with the same problem (#15) check this solution on real projects? Solves it bugs with cache?

@nechutny
@mishak87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants