Liquibase doesn't give a warning when an older version of the app is deployed

A couple of days ago my team had to revert a service to the previous version. During this process the latest changes of liquibase were still deployed in the database but weren’t part of the service that we just deployed, for instance, let’s say the latest liquibase changeset number is 60 (that’s what is stored in the DB) but the service only had changeset number 55.

The deployment went OK and since all checksums were the same up until 55, no warning was thrown and the app started to only start throwing exceptions in runtime.

I don’t know if this is a bug or a feature and if there’s something we can configure to have liquibase warning us that something might not be right.

Hi @pedrofuga,

What command are you using to run liquibase?

If for example you say liquibase update, liquibase will update the db with all available changesets. Which in your example would be 60. Liqubiase in typical config doesn’t know we only want a partial update b/c you rolled back some service it knows nothing about.

To do that you would have to use labels probably in your changesets with version of microservice it is valid for. The liquibase update command would have to contain what label you want to run. All of that would be typically in the pipeline orchestration (ex. Jenkins pipeline builder) and not within Liquibase’s config.

HTH

Ronak

I’m sorry, my explanation was a bit confusing, I’m going to try to explain it in a bit more detail and steps:

  • We deployed the version 123 of this service which contains the latest Liquibase changeset, for instance number 60
  • We figured out some issues and we had to revert the service to the previous version 122, which only knows about Liquibase changeset number 59
  • At this moment the service entities are not in sync with the DB anymore but we get no warning regarding that
    • DATABASECHANGELOG knows about the changeset 60
    • Code only knows about changeset 59
  • We started to get runtime errors due to entities mismatch

Do you know if there’s anything to warn us if this repeats again?