Review main Merged

50952[BUGFIX] Avoid version overlay if EXT:version is not loaded

Claus Due CR +2 V +2 Easy +5 −1 updated 01/27/17, 16:13

Commit message

PlainDataResolver will do semi-expensive operations for
workspaces-enabled tables even if EXT:version (and
therefore EXT:workspaces) is not loaded.

Doing a cheap check can prevent calling two such
operations and saves SQL queries and memory.

Review

  • Code review CR +2
    • Andreas Kienast +2
    • Wouter Wolters +1
    • Christian Kuhn +1
  • Verified V +2
    • Andreas Kienast +2
    • Christian Kuhn +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 2630

Show 35 earlier messages
  1. Claus Due uploaded patch set 1 12/13/16, 16:31

  2. TYPO3com voted on patch set 1 V -1 12/13/16, 16:36 Completed build in 04m 51s on Tue, 13 Dec, 05:36 PM Test Summary: 90 of 54391 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5742

  3. Claus Due uploaded patch set 2 12/13/16, 16:41

  4. TYPO3com voted on patch set 2 V +1 12/13/16, 16:46 Completed build in 05m 09s on Tue, 13 Dec, 05:46 PM Test Summary: 54391 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5743

  5. Mads Lønne Jensen commented on patch set 2 12/14/16, 13:17

    PlainDataResolver.php:145

    Have you checked if it is sound to reverse the order of applyLiveIds and processSorting?
  1. Claus Due commented on patch set 2 12/14/16, 13:40

    PlainDataResolver.php:145 Reply

    The output gets asserted in functional tests ~300 times but that's the only confirmation I've done. But it could possibly cause side effects that aren't tested for. This may also be rewritten further as to only call ->reindex() once after all processing so I'll restore the order.
  2. Wouter Wolters commented on patch set 2 12/15/16, 10:49

    EXT:version
    EXT:version
  3. Thomas Hohn commented on patch set 2 12/16/16, 06:00

    I would prefer that the order is keep to avoid "unkown" side effects like my latest PR on that issue to you
  4. Claus Due updated the commit message in patch set 3 12/22/16, 10:33

  5. Claus Due commented on patch set 2 12/22/16, 10:35

    This one should not be merged until https://review.typo3.org/#/c/51018/ is merged - and will then require a rebase/conflict-resolve.
  6. TYPO3com voted on patch set 3 V +1 12/22/16, 10:38 Completed build in 04m 32s on Thu, 22 Dec, 11:38 AM Test Summary: 54399 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5922

  7. Thomas Hohn voted on patch set 3 CR +1 V +1 01/21/17, 13:14

  8. Markus Klein commented on patch set 3 CR -1 01/21/17, 17:18

    PlainDataResolver.php:141

    IMO this check has to be done inside the functions process* and apply* as those are public.
  9. Thomas Hohn commented on patch set 3 01/26/17, 15:04

    PlainDataResolver.php:141 Reply

    Wouldn't it be better then to move that in the method isWorkspaceEnabled in order no tot to have that logic in all these methods? So something like protected function isWorkspaceEnabled() { if (ExtensionManagementUtility::isLoaded('version')) { return BackendUtility::isTableWorkspaceEnabled($this->tableName); } return false; }
  10. Markus Klein commented on patch set 3 01/26/17, 17:29

    Fine as well
  11. Thomas Hohn commented on patch set 3 CR 0 V 0 01/26/17, 17:36

    I think this one (https://review.typo3.org/#/c/51018/) is trivial and is required before this one - if you have 5 minutes til look at it it would be nice ;-)
  12. Thomas Hohn uploaded patch set 4 01/27/17, 05:43

  13. Thomas Hohn commented on patch set 4 01/27/17, 05:45

    Restored the original ordering in the get method and moved check into method isWorkspaceEnabled
  14. TYPO3com voted on patch set 4 V +1 01/27/17, 05:49 Completed build in 05m 24s on Fri, 27 Jan, 06:49 AM Test Summary: 55595 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7090

  15. Andreas Kienast voted on patch set 4 CR +1 01/27/17, 07:05

  16. Wouter Wolters voted on patch set 4 CR +1 01/27/17, 08:55

  17. Christian Kuhn commented on patch set 4 CR -1 01/27/17, 10:41

    PlainDataResolver.php:374

    I don't get the point: isLoaded() executes some methods on the PackageManager, while isTableWorkspaceEnabled() just does a "!empty($GLOBALS['TCA'][$table]['ctrl']['versioningWS'])". imho, this version is more expensive in the end. why should be do that?
  18. Christian Kuhn commented on patch set 4 CR 0 01/27/17, 10:45

    PlainDataResolver.php:374 Reply

    ah, scratch that. you want this suppressed if ext:version IS loaded, but ext:workspaces is not ... mmmh.
  19. Claus Due commented on patch set 4 01/27/17, 10:48

    > imho, this version is more expensive in the end. why should be do that? While it is true that checking the TCA is a lot faster than checking if extension is installed, two things come into play: 1) The operations related to versioning still occur even if the extension is not installed, if the TCA is set. The intention is to avoid this (expensive) processing to the added cost to check if installed, is cheaper when you don't use version/workspaces. 2) The response "is extension installed?" should afaik get cached so the check becomes an "isset" on an array member? Even so, delegating through the PackageManager should be cheaper than always running versioning operations when versions are configured but not enabled.
  20. Christian Kuhn commented on patch set 4 01/27/17, 10:53

    PlainDataResolver.php:374 Reply

    ok, stupid me, still different: you want to suppress the processing if a table if fit for workspace via TCA, but version and workspace are not loaded at all.
  21. Christian Kuhn commented on patch set 4 01/27/17, 10:55

    yeah, got it now. btw: suppressing the queries should do the main improvement. caching this stupid packageManager call, won't, i guess ... in the end, this is more or less a near-direct call, too.
  22. Claus Due commented on patch set 4 01/27/17, 10:58

    The solution was initially created on LTS and the PackageManager may be a bit simpler and more efficient there - I didn't double-check that. But yes, reducing the (many) SQL calls should give us the bonus we need :)
  23. Christian Kuhn voted on patch set 4 CR +1 V +1 01/27/17, 11:00

  24. Andreas Kienast voted on patch set 4 CR +2 V +2 01/27/17, 16:13

  25. Gerrit merged patch set 4 01/27/17, 16:13