Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13397

Possible cache inconsistency when asked XWikiDocument has a different wiki than the one in the context

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.4.4
    • 8.1-milestone-2
    • Old Core
    • None
    • Unknown
    • N/A
    • N/A

    Description

      Hibernate store loadXWikiDoc(XWikiDocument doc, XWikiContext context) implementation does not take into account doc wiki and search in the current database. This always been like this and a known behavior.

      The problem is that XWikiCacheStore#loadXWikiDoc does not take into account the context when calculating the document cache key and might end up associating the document currentwiki:Space.Page with the key docwiki:Space.Page.

      We don't have much issue with that because XWiki#getDocument is taking care of updating the context based on the document wiki but it's still dangerous.

      There is several possibility:

      1. stop searching in the context wiki and search in the document wiki instead
      2. calculate the new key based on the found instance

      1 is probably what makes more sense but since it's a behavior change it's probably a discussion for another time and another API probably, one not passing a context to be explicit.

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: