MongoDB with java mongoCK error Quit trying lock after 180000 millis due to LockPersistenceException

I implemented the Java Spring boot application and used mongoCK for controlling database change. In normal cases, it works well. Today I have a new changelog that has affected a huge of data(more than 500k documents). I got an error when mongoCK tried to update DB. It’s happened when the data changed around 380k documents.

io.mongock.driver.api.lock.LockCheckException: Quit trying lock after 180000 millis due to LockPersistenceException: 
	current lock:  LockEntry{key='DEFAULT_KEY', status='LOCK_HELD', owner='c83dd1ac-ece4-47a1-b189-3b818e58c139', expiresAt=Thu May 02 20:53:37 ICT 2024}
	new lock: Document{{$set=Document{{key=DEFAULT_KEY, status=LOCK_HELD, owner=c83dd1ac-ece4-47a1-b189-3b818e58c139, expiresAt=Thu May 02 20:53:38 ICT 2024}}}}
	acquireLockQuery: And Filter{filters=[Filter{fieldName='key', value=DEFAULT_KEY}, Filter{fieldName='status', value=LOCK_HELD}, Filter{fieldName='owner', value=c83dd1ac-ece4-47a1-b189-3b818e58c139}]}
	db error detail: not db error

Do you have any suggestion?

We faced a similar issue.

In our case it was that we called a method which was doing the update in the mongoDB but not waiting till it finishes.
With this the problem was that the mongock Job already considered the method to have finished and released the lock.

In the method above we were therefore trying to write to mongoDB without having a lock which caused the mentionned error.