# Bug in v4.21+ changesets are not run because AbstractUpdateCommandStep.isUpToDateFastCheck incorrectly caches value across schemas

**URL:** https://forum.liquibase.org/t/bug-in-v4-21-changesets-are-not-run-because-abstractupdatecommandstep-isuptodatefastcheck-incorrectly-caches-value-across-schemas/8286
**Category:** General Discussion
**Created:** [May 30, 2023, 9:09pm UTC](https://forum.liquibase.org/t/bug-in-v4-21-changesets-are-not-run-because-abstractupdatecommandstep-isuptodatefastcheck-incorrectly-caches-value-across-schemas/8286 "2023-05-30T21:09:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jglass](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jglass](https://forum.liquibase.org/u/jglass)
#### Post date: [May 30, 2023, 9:09pm UTC](https://forum.liquibase.org/t/bug-in-v4-21-changesets-are-not-run-because-abstractupdatecommandstep-isuptodatefastcheck-incorrectly-caches-value-across-schemas/8286/1 "2023-05-30T21:09:57Z")

</div>

Steps to reproduce:

- configure liquibase with at least one changeset
- call `liquibase = liquibaseFactory.createLiquibase(schemaName); liquibase.update("default")` with a schema that is up-to-date (i.e., has no changesets to apply)
- create a second schema
- call `liquibase = liquibaseFactory.createLiquibase(schemaName2); liquibase.update("default")`  
Expected behavior:  
liquibase updates the second schema with the configured changesets  
Actual behavior:  
liquibase does not update the second schema

The problem is that the first call to AbstractUpdateCommandStep.isUpToDateFastCheck is setting the entry for “default/()” in the upToDateFastCheck map to true (indicating no un-run changesets). That entry will never be changed, even for a different schema, so all subsequent calls to isUpToDateFastCheck will return true, and no changesets will be run.

This seems similar to the problem in v4.22.0 but I don’t know if it’s actually the same problem in a different guise.

---

<div class="post-metadata">

### Author: ![Hylke](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@Hylke](https://forum.liquibase.org/u/Hylke)
#### Post date: [July 28, 2023, 10:25am UTC](https://forum.liquibase.org/t/bug-in-v4-21-changesets-are-not-run-because-abstractupdatecommandstep-isuptodatefastcheck-incorrectly-caches-value-across-schemas/8286/2 "2023-07-28T10:25:57Z")

</div>

Just ran across the same issue while debugging why my Liquibase claimed my change logs were executed even though they clearly were not!  
The `cacheKey` should also contain the database url and databasechangelog, not just contexts and labelexpressions.

---

<div class="post-metadata">

### Author: ![kevin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/kevin/32/244_2.png) [@kevin](https://forum.liquibase.org/u/kevin)
#### Post date: [July 28, 2023, 1:47pm UTC](https://forum.liquibase.org/t/bug-in-v4-21-changesets-are-not-run-because-abstractupdatecommandstep-isuptodatefastcheck-incorrectly-caches-value-across-schemas/8286/3 "2023-07-28T13:47:48Z")

</div>

@jglass and @Hylke - there have been a series of updates to Liquibase recently that address checksum issues. Please try [Liquibase 4.23.0](https://forum.liquibase.org/t/liquibase-4-23-0-released) or later to see if that addresses your issue.

Note: the upcoming Liquibase 4.23.1 release (on track for a mid-August) handles a few more checksum-related edge cases if the 4.23.0 release doesn’t fully resolve the issues you’re currently experiencing.

---

<div class="post-metadata">

### Author: ![Hylke](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@Hylke](https://forum.liquibase.org/u/Hylke)
#### Post date: [July 28, 2023, 3:23pm UTC](https://forum.liquibase.org/t/bug-in-v4-21-changesets-are-not-run-because-abstractupdatecommandstep-isuptodatefastcheck-incorrectly-caches-value-across-schemas/8286/4 "2023-07-28T15:23:06Z")

</div>

I’m using 4.23.0. It does not correctly calculate the `cacheKey`, and stores it in a static map, breaking subsequent runs.

---

<div class="post-metadata">

### Author: ![jglass](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jglass](https://forum.liquibase.org/u/jglass)
#### Post date: [November 27, 2023, 3:54pm UTC](https://forum.liquibase.org/t/bug-in-v4-21-changesets-are-not-run-because-abstractupdatecommandstep-isuptodatefastcheck-incorrectly-caches-value-across-schemas/8286/5 "2023-11-27T15:54:45Z")

</div>

I have verified that the problem is fixed in the 4.25.0 release.
