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

versionCache is not cleaned when a subwiki is deleted, making it impossible to recreate a subwiki with the same name.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.4-milestone-1
    • Fix Version/s: 4.1-milestone-1, 4.0.1
    • Component/s: Old Core
    • Labels:
      None
    • keywords:
      store migration version cache clear wiki delete
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      How to reproduce the effects:
      1. Go to the WikiManager/CreateNewWiki page and create a simple (empty) wiki named 'testdoublecreation'
      2. After it finishes to be created, go to WikiManager/WebHome and delete the just created wiki
      3. Repeat step 1

      You will see an error like:

      Wiki "testdoublecreation" creation failed: Error number 50035 in 5: Exception in plugin xpn.xwiki.plugin.wikimanager.Wiki Manager Plugin?: Wiki testdoublecreation? database update failed Wrapped Exception: Error number 3202 in 3: Exception while reading document name = [XWiki Preferences?, type = DOCUMENT?, parent = name = [XWiki?, type = SPACE?, parent = name = [testdoublecreation?, type = WIKI?, parent = null?]]] Wrapped Exception: could not load an entity: xpn.xwiki.doc.XWiki Document?.
      

      Workaround:

      Restart XWiki and the in-memory caches will be cleared so the subwiki can be again created.

      Technical details:

      The version check will only be null the first time the subwiki is created:
      AbstractDataMigrationManager.java

      The next times it will always be found in the versionCache because the version cache is never cleared on wiki deletion:
      XWikiCacheStore.java #flushCache()
      – called by:
      XWikiCacheStore.java #deleteWiki()
      XWikiCacheStore.java #onEvent() <- triggered by com.xpn.xwiki.plugin.wikimanager.doc.Wiki#delete()

      Maybe a solution would be to make AbstractDataMigrationManager implement EventListener and listen to WikiDeletedEvent. Then, on the event, it could set the versionCache key corresponding to the just deleted wiki to null.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                softec Denis Gervalle
                Reporter:
                enygma Eduard Moraru
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: