database icon indicating copy to clipboard operation
database copied to clipboard

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

Open hranicka opened this issue 10 years ago • 4 comments
trafficstars

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.

hranicka avatar Mar 16 '15 21:03 hranicka

Tests are failing…

dg avatar Mar 26 '15 18:03 dg

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).

hranicka avatar Mar 26 '15 22:03 hranicka

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

dg avatar Mar 26 '15 22:03 dg

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

@nechutny @mishak87

hranicka avatar Mar 27 '15 07:03 hranicka