Duplicated records in the table databasechangelog

Hi Liquibase Team.

We have some strange behavior with the table databasechangelog. We have duplicated records in the table. The “normal state” of the table is 98 records. Our stage database has 195 records. Our production database has 100 records. We can see the duplicates in our databases on stage and prod, but all these databases use the same master.xml file for liquibase. We used liquibase from 3.8.6 (maybe even older) and now we use 4.6.2 , database - Postgres 12.6

Can you explain the behavior? Will we have some problems in the future because of these duplicates? Should we do anything with them?

Please, let me know if you have any additional questions.

Kind regards,
Captain1653

@Captain1653 could you add an example of a duplicate case (feel free to change the details (i.e author, filename) if this is sensitive data) from databasechangelog table?
I am curious if the filename field is a little different (or not).

Thanks,
Eduard

@EduardUta thank you for the quick reply.

I have attached the screenshot of our stage database. Is it enough for you?

Kind regards,
Captain1653

@Captain1653 hmm, interesting. Could you also add the author field to the select list (asking because id, author and filename attributes and their uniqueness is one of the most important things to look into).
Would also help including dateexecuted and deployment_id (or feel free to take the easy path and include all).
On a side note, regarding the existent duplicates and future deployments, I would leave them there for the time being until a root cause is identified for this particular case.
Liquibase checks this databasechangelog table and based on the existence of the combination of id, author and filename decides if a particular changeset is executed or not on that target DB (unless of course this is “overwritten” with runAlways properties etc etc).
So for the moment and in the future, things are safe, but again, once a root cause is identified and you can know for sure that the id, author, filename that you decide to keep in the databasechangelog table have associated changesets (having exact values) in the changelogs then, of course, a sanitization can be done, to get rid of the unneeded duplicates.

Thanks,
Eduard

@EduardUta Thank you for your explanation.

I have added those fields and liquibase too (maybe it will be useful).

Please, let me know if you have any additional questions.

Kind regards,
Captain1653