Fixed bug in pruning phase on node startup

This was causing very recent AT states to be deleted accidentally, because we weren't rebuilding the LatestATStates table before running the query. We should add unit tests to cover this process in case there are any other undiscovered problems.
This commit is contained in:
CalDescent 2021-09-24 20:52:45 +01:00
parent 841b6c4ddf
commit 19bf8afece

View File

@ -96,6 +96,10 @@ public class HSQLDBDatabasePruning {
final int blockStep = 10000;
// It's essential that we rebuild the latest AT states here, as we are using this data in the next query.
// Failing to do this will result in important AT states being deleted, rendering the database unusable.
repository.getATRepository().rebuildLatestAtStates();
// Loop through all the LatestATStates and copy them to the new table
LOGGER.info("Copying AT states...");