Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add information somewhere in docs about unlocking postgres db #2257

Open
vdelendik opened this issue Oct 29, 2020 · 2 comments
Open

add information somewhere in docs about unlocking postgres db #2257

vdelendik opened this issue Oct 29, 2020 · 2 comments
Milestone

Comments

@vdelendik
Copy link
Contributor

we have potential use-case when DB is locked during upgrade/restart/termination etc.
Appropriate steps should be published in documention howto solve the problem:

// login into the container and remove lock:
docker exec -ti postgres bash
psql -d postgres -U postgres -c "delete from zafira.databasechangeloglock"
and restart everything

exception in reporting logs:
2020-10-28 06:30:28.034 INFO [zafira] [main] liquibase.executor.jvm.JdbcExecutor: SELECT LOCKED FROM zafira.databasechangeloglock WHERE ID=1 2020-10-28 06:30:28.035 INFO [zafira] [main] l.lockservice.StandardLockService: Waiting for changelog lock.... 2020-10-28 06:30:38.036 INFO [zafira] [main] liquibase.executor.jvm.JdbcExecutor: SELECT LOCKED FROM zafira.databasechangeloglock WHERE ID=1 2020-10-28 06:30:38.040 INFO [zafira] [main] l.lockservice.StandardLockService: Waiting for changelog lock.... 2020-10-28 06:30:48.040 INFO [zafira] [main] liquibase.executor.jvm.JdbcExecutor: SELECT LOCKED FROM zafira.databasechangeloglock WHERE ID=1 2020-10-28 06:30:48.042 INFO [zafira] [main] l.lockservice.StandardLockService: Waiting for changelog lock.... 2020-10-28 06:30:58.044 INFO [zafira] [main] liquibase.executor.jvm.JdbcExecutor: SELECT ID,LOCKED,LOCKGRANTED,LOCKEDBY FROM zafira.databasechangeloglock WHERE ID=1 2020-10-28 06:30:58.068 ERROR [zafira] [main] c.q.z.d.state.DatabaseStateManager: Could not acquire change log lock. Currently locked by 114e7a89206c (172.18.0.11) since 9/4/20, 12:03 PM liquibase.exception.LockException: Could not acquire change log lock. Currently locked by 114e7a89206c (172.18.0.11) since 9/4/20, 12:03 PM at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:236) at liquibase.Liquibase.update(Liquibase.java:184)

@vdelendik vdelendik changed the title add information somewhere in docs about uncloking postgres db add information somewhere in docs about unlocking postgres db Nov 23, 2020
@FredVaugeois
Copy link

If we could add the ability to see the logs of the service that is actually locking the database to be able to know when the process really is done. That way we would be able to know when to delete the lock if the process did not unlock it by itself.

@vdelendik vdelendik added this to the 1.28 milestone Feb 13, 2022
@vdelendik
Copy link
Contributor Author

unlock db forcibly using native postgres advisory locks service. in this case after stop we focibly unclock db for the next attempt.

@vdelendik vdelendik modified the milestones: 1.28, 2.0 Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants