Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-30545

Improve robustness of DBSSession.remove(String rootId) wrt reference of non-existent proxies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.10, 2021.0
    • Fix Version/s: 10.10-HF55, 2021.13
    • Component/s: Core DBS
    • Environment:
      specific to DBS implementation of proxies
    • Release Notes Summary:
      A document can be removed when it's a target of a deleted proxy.
    • Backlog priority:
      750
    • Sprint:
      nxplatform #49
    • Story Points:
      5

      Description

      In the 10.10 code of DBSSession.remove(String rootId),

              // if a proxy target is removed, check that all proxies to it
              // are removed
              for (Entry<String, Object[]> en : targetProxies.entrySet()) {
                  String targetId = en.getKey();
                  for (Object proxyId : en.getValue()) {
                      if (!removedIds.contains(proxyId)) {
                          throw new DocumentExistsException("Cannot remove " + rootId + ", subdocument " + targetId
                                  + " is the target of proxy " + proxyId);
                      }
                  }
              }
      

      DocumentExistsException should not be thrown when the referenced proxy does not exist

      Experience in Nuxeo Cloud shows that although NXP-30010/NXP-30048 are implemented, there exists edge cases, likely due to concurrence, where a proxy which has successfully been deleted is still referenced by a target document.
      Then, this target document cannot be deleted due to the referenced non-existent proxy.

      It is requested that before DocumentExistsException is thrown, a check on the state of existence of the proxy is made.

      Expected result: it is possible to delete "as in normal circumstances" a target document, even when it references non-existent proxyIds.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: