The database is locked is happening with nodes with a slow disk or when the database is fragmented too much. Usually it resolves itself after a while, but the restart is helping too. Also, you can try to vacuum your database:
database is locked
By the way what the filesystem on that drive?