Browse Source

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.
block-archive
CalDescent 3 years ago
parent
commit
19bf8afece
  1. 4
      src/main/java/org/qortal/repository/hsqldb/HSQLDBDatabasePruning.java

4
src/main/java/org/qortal/repository/hsqldb/HSQLDBDatabasePruning.java

@ -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...");

Loading…
Cancel
Save