From 60e9a533b50ae1ca4483b3512fbbb228cb25b950 Mon Sep 17 00:00:00 2001 From: roadscape Date: Wed, 23 Jan 2019 10:02:49 -0600 Subject: [PATCH 1/2] more aggressive autovac --- hive/db/schema.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hive/db/schema.py b/hive/db/schema.py index eaf2c21bd..6ffeec4fc 100644 --- a/hive/db/schema.py +++ b/hive/db/schema.py @@ -340,14 +340,14 @@ def reset_autovac(db): autovac_config = { # vacuum analyze 'hive_accounts': (50000, 100000), - 'hive_posts_cache': (25000, 25000), + 'hive_posts_cache': (10000, 25000), 'hive_posts': (2500, 10000), - 'hive_post_tags': (5000, 10000), - 'hive_follows': (5000, 5000), - 'hive_feed_cache': (5000, 5000), - 'hive_blocks': (5000, 25000), - 'hive_reblogs': (5000, 5000), - 'hive_payments': (5000, 5000), + 'hive_post_tags': (2500, 10000), + 'hive_follows': (2500, 5000), + 'hive_feed_cache': (2500, 5000), + 'hive_blocks': (2500, 25000), + 'hive_reblogs': (2500, 5000), + 'hive_payments': (2500, 5000), } for table, (n_vacuum, n_analyze) in autovac_config.items(): From e1eb3ccefc539a2341e2a9604e3b80cdb0d63e4c Mon Sep 17 00:00:00 2001 From: roadscape Date: Tue, 5 Feb 2019 13:29:38 -0600 Subject: [PATCH 2/2] minor logging tune --- hive/indexer/cached_post.py | 3 ++- hive/server/condenser_api/objects.py | 4 ++-- hive/steem/block/schedule.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hive/indexer/cached_post.py b/hive/indexer/cached_post.py index 0b4abf010..0c1400b6d 100644 --- a/hive/indexer/cached_post.py +++ b/hive/indexer/cached_post.py @@ -408,6 +408,7 @@ def _sql(cls, pid, post, level=None): - `update`: post was modified - `payout`: post was paidout - `upvote`: post payout/votes changed + - `recount`: post has new child """ #pylint: disable=bad-whitespace @@ -415,7 +416,7 @@ def _sql(cls, pid, post, level=None): # last-minute sanity check to ensure `pid` is correct #78 pid2 = cls._get_id(post['author']+'/'+post['permlink']) - assert pid == pid2, "hpc id %d maps to %d" % (pid, pid2) + assert pid == pid2, "hpc id %d maps to %d %s" % (pid, pid2, repr(post)) # inserts always sequential. if pid > last_id, this operation # *must* be an insert; so `level` must not be any form of update. diff --git a/hive/server/condenser_api/objects.py b/hive/server/condenser_api/objects.py index d0d641309..06b6e08dc 100644 --- a/hive/server/condenser_api/objects.py +++ b/hive/server/condenser_api/objects.py @@ -73,7 +73,7 @@ async def load_posts(db, ids, truncate_body=0): # in rare cases of cache inconsistency, recover and warn missed = set(ids) - posts_by_id.keys() if missed: - log.warning("get_posts do not exist in cache: %s", repr(missed)) + log.info("get_posts do not exist in cache: %s", repr(missed)) for _id in missed: ids.remove(_id) sql = ("SELECT id, author, permlink, depth, created_at, is_deleted " @@ -86,7 +86,7 @@ async def load_posts(db, ids, truncate_body=0): VALUES (:id, :author, :permlink)""" await db.query(sql, **post) else: - log.warning("requested deleted post: %s", dict(post)) + log.info("requested deleted post: %s", dict(post)) return [posts_by_id[_id] for _id in ids] diff --git a/hive/steem/block/schedule.py b/hive/steem/block/schedule.py index 6dec79c52..26f06d6b9 100644 --- a/hive/steem/block/schedule.py +++ b/hive/steem/block/schedule.py @@ -87,7 +87,7 @@ def _check_missing(self, num, prev_date, next_date): missed = (gap_secs / self.BLOCK_INTERVAL) - 1 if missed: self._add_missed(missed) - log.warning("%d missed @ block %d", missed, num) + log.info("%d missed @ block %d", missed, num) def _drift_backward(self, delta=0.1): """Delay the schedule by 0.1s when a block fetch failed."""