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.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 4.1-milestone-1, 4.0.1
    • 3.4-milestone-1
    • Old Core
    • None
    • store migration version cache clear wiki delete
    • Unknown
    • N/A
    • N/A

    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

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

              Dates

                Created:
                Updated:
                Resolved: