Skip to content
Snippets Groups Projects
Commit 1f13a7b0 authored by Marcin's avatar Marcin
Browse files

fix for massive_with_indexes wrongly recalculate all posts childs

Previously sync cannot leave MASSIVE_WITH_INDEXES because update_all_hive_posts_children_count()
and VACUUM were called
parent 40f8a4bb
No related branches found
No related tags found
2 merge requests!827Merge develop changes to master,!709fix for massive_with_indexes wrongly recalculate all posts childs
...@@ -13,6 +13,7 @@ import sqlalchemy ...@@ -13,6 +13,7 @@ import sqlalchemy
from hive.conf import ( from hive.conf import (
SCHEMA_NAME SCHEMA_NAME
,SCHEMA_OWNER_NAME ,SCHEMA_OWNER_NAME
,ONE_WEEK_IN_BLOCKS
) )
from hive.db.adapter import Db from hive.db.adapter import Db
...@@ -553,9 +554,15 @@ class DbState: ...@@ -553,9 +554,15 @@ class DbState:
cls.db().query_no_return("COMMIT") cls.db().query_no_return("COMMIT")
cls.ensure_reputations_recalculated(last_completed_blocks, last_imported_blocks) cls.ensure_reputations_recalculated(last_completed_blocks, last_imported_blocks)
cls._execute_query(db=cls.db(), sql="VACUUM (VERBOSE,ANALYZE)") is_initial_massive = (last_imported_blocks - last_completed_blocks) > ONE_WEEK_IN_BLOCKS
cls._finish_all_tables(True, last_completed_blocks, last_imported_blocks)
cls._execute_query(db=cls.db(), sql="VACUUM (VERBOSE,ANALYZE)") if is_initial_massive:
cls._execute_query(db=cls.db(), sql="VACUUM (VERBOSE,ANALYZE)")
cls._finish_all_tables( is_initial_massive, last_completed_blocks, last_imported_blocks)
if is_initial_massive:
cls._execute_query(db=cls.db(), sql="VACUUM (VERBOSE,ANALYZE)")
log.info("[MASSIVE] Massive sync complete!") log.info("[MASSIVE] Massive sync complete!")
return True return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment