Review main Merged

75438[TASK] Change handling of apcu cache flush action

Falk Berger CR +2 V +2 Easy +4 −6 updated 07/26/23, 14:14

Commit message

Change the cache flush action of the apcu backend to flush
by prefix, in order to require less metadata to be stored.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1217

  1. Falk Berger uploaded patch set 1 08/13/22, 11:32

  2. core-ci voted on patch set 1 V -1 08/13/22, 11:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30140

  3. Stefan Bürk uploaded patch set 2 08/15/22, 07:01

  4. Stefan Bürk commented on patch set 2 CR -1 08/15/22, 07:03

    Not really happy with the commit message - will change this ...
  5. core-ci voted on patch set 2 V +1 08/15/22, 07:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30176

  6. Stefan Bürk commented on patch set 2 08/15/22, 07:21

    Reply

    I think this change leads to cache corruption - will validate this later and will push changed commit message than.
  7. Anja Leichsenring commented on patch set 2 10/20/22, 17:42

    @Stefan ping? You still remember this?
  8. Stefan Bürk commented on patch set 2 CR 0 10/20/22, 18:32

    Reply

    Thanks for ping. What I thought as cache corruption was a wrong impression. So will remove the -1 for now. However, I'm not sure about the iterator flag `APC_ITER_NONE` which is used .... the different APC_ITER_* flags are not really explained on php.net, and no experience with it. This should be at least explained why this flag has been selected and why

    ApcuBackend.php:211

    Why has been `APC_ITER_NONE` flag choosen for "$format" vs the default of `APC_LIST_ACTIVE` ? Are there any helpfull source explaining the differences between the APC_ITER_* flags, so I(we) can check if this is the proper flag for the usage ?
  9. Benni Mack updated the commit message in patch set 3 V +1 05/03/23, 09:24

  10. core-ci voted on patch set 3 V -1 05/03/23, 11:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41408

  11. Stefan Bürk uploaded patch set 4 V -1 07/20/23, 00:10

  12. core-ci voted on patch set 4 V -1 07/20/23, 00:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44323

  13. Benjamin Franzke uploaded patch set 5 V -1 07/26/23, 12:43

  14. Benjamin Franzke commented on patch set 5 07/26/23, 12:43

    Reply

    I guess this was your impression because APC_ITER_KEY was "missing"? See other comment, not needed due to internal handling of the apcu iterator. I also updated the commit message to make clear that this commit is about apcu, not cache flush command (sounds like cli) in general.

    Reply

    Done, see other comment.

    ApcuBackend.php:211 Reply

    The flags signal which variables should be "filled" in the resulting iterator array – when the iterator is mapped to an array. With APC_ITER_NONE the array would be empty (to avoid filling the memory with unneeded data), which *would* be useful if we'd iterate ourselves: foreach ($iterator as $key => $emptyArrayToBeIgnored) apcu_delete($key); But, as the iterator is passed through to the internal apcu_delete method, the iterator is "iterated" internally, without mapping it to an array at all: https://github.com/krakjoe/apcu/blob/49ca3737461bd10d248796a3e7c33cf98f6ba5d0/php_apc.c#L759-L760 https://github.com/krakjoe/apcu/blob/49ca3737461bd10d248796a3e7c33cf98f6ba5d0/apc_iterator.c#L577-L601 …and therefore the flags are actually unneded. Removed them for that reason.
  15. core-ci voted on patch set 5 V +1 07/26/23, 12:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44582

  16. Stefan Bürk commented on patch set 5 V +2 CR +2 07/26/23, 13:56

    Reply

    Have done some research recently to fill my knowledge lack here. Thanks for adding the explanation here and in the other comment. Matching what I found out. Just didn't found the patch again ;).
  17. Stefan Bürk merged patch set 6 07/26/23, 14:14