You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
migrate-db: no checking if the existing postgres database matches the bbolt database being converted #47
Restore LND data directory to the state before migration
Try to migrate again to postgres
In this scenario, lndinit migrate-db checks to see if there is a tombstone marker on source DB and when it does not see it, it then checks the postgres database for indication of successful completion. The postgres database sees the successful completion has been marked and then reports !!!Migration of all mandatory db parts completed successfully!!!. In this situation, it did not actually verify anything, it just assumed the old database matches the new one and I don't think it add a tombstone marker to the old database. I think in this scenario, there should be an error message because the old and new DB should both be in agreement on if the conversion happened or not.
Here is another scenario I've tested:
Migrate DB to postgres for node bob
Try to migrate the DB to postgres for node charlie, using the same postgres DB server as bob
I get !!!Migration of all mandatory db parts completed successfully!!!
In this case, I would have expected either of the following
Error out and say you can't use the same postgres server for 2 nodes, or
Create a separate DB inside the same postgres server for the second node.
I can see a situation where one might be running multiple nodes and accidentally use the wrong postgres server when running the conversion tool and I think we need some kind of checking for that. What does LND do if you accidentally point 2 nodes to the same postgres server? Does it have any kind of check?
Fixed on current working branch. We now make sure the markers are always on both dbs. Moreover we make sure that in case we start a new migration we expect the destination db to be empty. So in the case where we you tried to migrate a new node to the same dns db address, it would now fail and require you to delete the db manually. At this point you should recognize that you are doing something wrong.
Activity
ziggie1984 commentedon Apr 13, 2025
Fixed on current working branch. We now make sure the markers are always on both dbs. Moreover we make sure that in case we start a new migration we expect the destination db to be empty. So in the case where we you tried to migrate a new node to the same dns db address, it would now fail and require you to delete the db manually. At this point you should recognize that you are doing something wrong.
ziggie1984 commentedon Apr 17, 2025
Fixed with master.