Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53964

Drop uuid_checksum_uniq unique key constraint

XMLWordPrintable

    • Evergreen - Milestone 2

      Problem statement

      The versions table has a unique key constraint on the checksum and uuid fields.

      This is a problem because when the reportVersions call is made after a rollback, the insertion is rejected since it would violate that constraint.
      But in case of a rollback, this is absolutely normal and expected that we are going to get back to a previous known state, so the backend should not reject it.

      Currently, this is rejected like the following:

      backend_1   | error: Error during call: BadRequest: Validation error
      instance_1  | error: Failed to report versions message=Validation error, type=FeathersError, name=BadRequest, code=400, className=bad-request, data=undefined, errors=[message=uuid must be unique, type=unique violation, path=uuid, value=d87c40a9-fd67-45d8-a718-531cd81ab23b, origin=DB, id=null, uuid=d87c40a9-fd67-45d8-a718-531cd81ab23b, schema=1, commit=faf226350db4e8e09a39d81f7f361b665a5435f2
      

      Apart from rollback, this case could even also happen if we decide to push a new UL that takes back a new plugin to a previous version, or even remove a plugin that got added for some testing phase (like what rtyler did live during his DWJW2018 talk, showing a plugin, then removing it).

      Expected behavior

      This should not trigger an error.

            batmat Baptiste Mathus
            batmat Baptiste Mathus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: