Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync tuning #178

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions hive/db/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
3 changes: 2 additions & 1 deletion hive/indexer/cached_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,15 @@ 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
assert post['author'], "post {} is blank".format(pid)

# 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.
Expand Down
4 changes: 2 additions & 2 deletions hive/server/condenser_api/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion hive/steem/block/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down