Commit Graph

11 Commits

Author SHA1 Message Date
Eng Zer Jun
dd07cb850d
channeldb: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-08-24 08:58:16 +08:00
yyforyongyu
0735522194
multi: fix make fmt 2022-08-23 22:10:24 +08:00
yyforyongyu
b391503ddf
migration30: validate migration results before deleting old buckets
This commit adds a new method `validateMigration` to be used prior to
the deletion of the old buckets to be extraly cautious.
2022-07-12 21:01:12 +08:00
yyforyongyu
78a73f9761
migration30: cover the case where v0.15.0 is active
This commit changes how we locate the next migration height by including
the scenario where `lnd@v0.15.0` is active. In the new version, we will
see a mixed of new and old logs under the same open channel bucket.
Hence, we need to alter how we locate the next un-migrated height.
2022-07-12 21:01:12 +08:00
yyforyongyu
1832a93d19
migration30: add benchmark test 2022-07-12 21:01:11 +08:00
yyforyongyu
5316fcd6c9
migration30+migtest: add unit tests for migration 2022-07-12 21:01:11 +08:00
yyforyongyu
61bff6086c
migration30: add migration to convert old revocation logs
This commit adds the migration that's used to convert the old revocation
logs into the new format. The migration is fault-tolerant, meaning the
process can be interrupted and the migration will pick up what's left
when running again. We also cap how many records to be processed in each
db transaction to prevent OOM.
2022-07-12 21:01:08 +08:00
yyforyongyu
2a06145137
migration30: add unit tests for iterator 2022-07-12 20:51:48 +08:00
yyforyongyu
75dbbb55ad
migration30: add supporting functions to help with unit tests
This commit adds supporting functions that will be used in the unit
test. The testing data are also added as hard-coded. We choose to copy
the most of the testing data from our itest results such that a) they
are "real" data that can be used to calculate scripts and b) we preserve
the result generated by the current code so a future change won't affect
our test.
2022-07-12 20:51:48 +08:00
yyforyongyu
ebbdf78d52
migration30: add iterator to assist migration
This commit adds several utility functions to assist the migration. In
particular, an updateLocator is added to gives us the next un-migration
position in our buckets. This locator helps us to continue the job
in case of an interrupted migration. It also serves as an indicator on
whether the migration is finished or not.
2022-07-12 20:51:45 +08:00
yyforyongyu
674b0ec5fb
migration30: add related revocation log and lnwallet code
This commit adds relevant code from the revocation_log.go and the
package lnwallet. The code is needed to migrate the data, and we choose
to copy the code instead of importing to preserve the version such that
a future change won't affect current migration. An alternative would be
tagging each of the packages imported.
2022-07-08 13:17:57 +08:00