Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-10845

Additional database constraints to prevent erroneous duplication of the same row

    XMLWordPrintable

Details

    • 6
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      In one customer's environment, their virus checker occasional hangs the confluence server for up to 3 seconds. During one such time, a customer tried to add a page to favourites 3 times and thus when the server began processing, it ended up adding three rows into the content_label table. Now when trying to remove the page from favourites, it results in the error covered by CONF-13516. The customer should not be able to get into a situation like this.

      To prevent this situation, we can add more constraints on the database level.

      A similar problem occurs with the content table for pages and blog posts. There are no database restrictions on page title + space key + version uniqueness for pages, so there's a race condition where two requests to save a page come in at exactly the same time, check for an existing version – don't find one – and proceed with saving the new version in duplicate.

      However, implementing this in the CONTENT table is a tad difficult, where the restrictions would need to be based on the CONTENTTYPE column being "PAGE" or "BLOGPOST". We can't implement this in a database independent way with Hibernate. The CONTENT table would need to be split up by class to implement this for all customers, which raises a whole host of other problems.

      Our current recommendation is that customers investigate implementing the database constraints themselves if they are interested in getting this additional level of security. In general, Confluence is designed to handle the duplicates gracefully rather than prevent them in the first place. (Hence CONF-13516 where multiple labels caused problems is fixed as a bug separate to this improvement.)

      Attachments

        Issue Links

          Activity

            People

              barconati BillA
              pkamal Partha
              Votes:
              5 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: