Skip to content
Snippets Groups Projects

issue #89: net_votes and total_votes are calculated during sync

Merged issue #89: net_votes and total_votes are calculated during sync
Merged Marcin requested to merge mi_issue_89_total_votes into develop

Merge request reports

Checking pipeline status.

Approval is optional

Merged by Bartek WronaBartek Wrona 4 years ago (Nov 13, 2020 8:27pm UTC)

Merge details

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Marcin changed title from issue #87 (closed): net_votes and total_votes is calculated during sync to issue #87 (closed): net_votes and total_votes are calculated during sync

    changed title from issue #87 (closed): net_votes and total_votes is calculated during sync to issue #87 (closed): net_votes and total_votes are calculated during sync

  • Marcin added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin added 2 commits

    added 2 commits

    • 107c90a6 - issue #87 (closed): net_votes and total_votes are calculated during sync
    • cb32570f - upgrade for hive_posts total_votes and net_votes

    Compare with previous version

  • Marcin changed title from issue #87: net_votes and total_votes are calculated during sync to issue #89: net_votes and total_votes are calculated during sync

    changed title from issue #87: net_votes and total_votes are calculated during sync to issue #89: net_votes and total_votes are calculated during sync

  • Marcin added 3 commits

    added 3 commits

    Compare with previous version

  • Marcin marked as a Work In Progress

    marked as a Work In Progress

  • Marcin added 4 commits

    added 4 commits

    Compare with previous version

  • Marcin unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Marcin added 5 commits

    added 5 commits

    Compare with previous version

  • Upgraded production database fails syncing: sqlalchemy.exc.IntegrityError: (psycopg2.errors.NotNullViolation) null value in column "total_votes" violates not-null constraint:

    WARNING - hive.db.adapter - [SQL-ERR] IntegrityError in query 
                SELECT is_new_post, id, author_id, permlink_id, post_category, parent_id, community_id, is_valid, is_muted, depth
                FROM process_hive_post_operation((:author)::varchar, (:permlink)::varchar, (:parent_author)::varchar, (:parent_permlink)::varchar, (:date)::timestamp, (:community_support_start_date)::timestamp, (:block_num)::integer);
                 ({'author': 'machan', 'permlink': 'fight-for-your-dreams-for-what-you-want-to-be', 'parent_author': '', 'parent_permlink': 'hive-148441', 'date': '2020-11-13T11:30:57', 'community_support_start_date': '2019-10-22T07:12:36', 'block_num': 48649246})
    ERROR - hive.indexer.blocks - exception encountered block 48649246
    ERROR - hive.indexer.sync - Exception caught during processing blocks...
    Traceback (most recent call last):
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1628, in _execute_context
        self.dialect.do_execute(
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/engine/default.py", line 663, in do_execute
        cursor.execute(statement, parameters)
    psycopg2.errors.NotNullViolation: null value in column "total_votes" violates not-null constraint
    DETAIL:  Failing row contains (100510589, 0, 0, 1327225, 100510589, 26192444, 1369030, 2020-11-13 11:30:57, 0, 0, f, f, t, 0.000, 0, 0.000, 0.000, 2020-11-20 11:30:57, 1970-01-01 00:00:00, 2020-11-13 11:30:57, f, f, f, f, f, 6688.61, 160527, 0.000 HBD, 0, 0, 0, 0, 0, 0, 0, 2020-11-13 11:30:57, 2020-11-20 11:30:57, 10000, 0.000 HBD, 1000000.000 HBD, t, t, [], 48649246, 48649246, null, null).
    CONTEXT:  PL/pgSQL function process_hive_post_operation(character varying,character varying,character varying,character varying,timestamp without time zone,timestamp without time zone,integer) line 59 at RETURN QUERY
    
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/home/syncad/.local/lib/python3.8/site-packages/hivemind-0.0.1+16094486-py3.8.egg/hive/indexer/sync.py", line 130, in _block_consumer
        Blocks.process_multi(blocks, preparedVops, is_initial_sync)
      File "/home/syncad/.local/lib/python3.8/site-packages/hivemind-0.0.1+16094486-py3.8.egg/hive/indexer/blocks.py", line 110, in process_multi
        raise e
      File "/home/syncad/.local/lib/python3.8/site-packages/hivemind-0.0.1+16094486-py3.8.egg/hive/indexer/blocks.py", line 107, in process_multi
        last_num = cls._process(block, vops)
      File "/home/syncad/.local/lib/python3.8/site-packages/hivemind-0.0.1+16094486-py3.8.egg/hive/indexer/blocks.py", line 268, in _process
        Posts.comment_op(op, cls._head_block_date)
      File "/home/syncad/.local/lib/python3.8/site-packages/hivemind-0.0.1+16094486-py3.8.egg/hive/indexer/posts.py", line 98, in comment_op
        row = DB.query_row(sql, author=op['author'], permlink=op['permlink'], parent_author=op['parent_author'],
      File "/home/syncad/.local/lib/python3.8/site-packages/hivemind-0.0.1+16094486-py3.8.egg/hive/db/adapter.py", line 101, in query_row
        res = self._query(sql, **kwargs)
      File "/home/syncad/.local/lib/python3.8/site-packages/hivemind-0.0.1+16094486-py3.8.egg/hive/db/adapter.py", line 200, in _query
        raise e
      File "/home/syncad/.local/lib/python3.8/site-packages/hivemind-0.0.1+16094486-py3.8.egg/hive/db/adapter.py", line 192, in _query
        result = self._exec(query, **kwargs)
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1123, in execute
        return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/sql/elements.py", line 310, in _execute_on_connection
        return connection._execute_clauseelement(
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1312, in _execute_clauseelement
        ret = self._execute_context(
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1671, in _execute_context
        self._handle_dbapi_exception(
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1852, in _handle_dbapi_exception
        util.raise_(
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/util/compat.py", line 180, in raise_
        raise exception
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1628, in _execute_context
        self.dialect.do_execute(
      File "/home/syncad/.local/lib/python3.8/site-packages/SQLAlchemy-1.4.0b1-py3.8-linux-x86_64.egg/sqlalchemy/engine/default.py", line 663, in do_execute
        cursor.execute(statement, parameters)
    sqlalchemy.exc.IntegrityError: (psycopg2.errors.NotNullViolation) null value in column "total_votes" violates not-null constraint
    DETAIL:  Failing row contains (100510589, 0, 0, 1327225, 100510589, 26192444, 1369030, 2020-11-13 11:30:57, 0, 0, f, f, t, 0.000, 0, 0.000, 0.000, 2020-11-20 11:30:57, 1970-01-01 00:00:00, 2020-11-13 11:30:57, f, f, f, f, f, 6688.61, 160527, 0.000 HBD, 0, 0, 0, 0, 0, 0, 0, 2020-11-13 11:30:57, 2020-11-20 11:30:57, 10000, 0.000 HBD, 1000000.000 HBD, t, t, [], 48649246, 48649246, null, null).
    CONTEXT:  PL/pgSQL function process_hive_post_operation(character varying,character varying,character varying,character varying,timestamp without time zone,timestamp without time zone,integer) line 59 at RETURN QUERY
    
    [SQL: 
                SELECT is_new_post, id, author_id, permlink_id, post_category, parent_id, community_id, is_valid, is_muted, depth
                FROM process_hive_post_operation((%(author)s)::varchar, (%(permlink)s)::varchar, (%(parent_author)s)::varchar, (%(parent_permlink)s)::varchar, (%(date)s)::timestamp, (%(community_support_start_date)s)::timestamp, (%(block_num)s)::integer);
                ]
    [parameters: {'author': 'machan', 'permlink': 'fight-for-your-dreams-for-what-you-want-to-be', 'parent_author': '', 'parent_permlink': 'hive-148441', 'date': '2020-11-13T11:30:57', 'community_support_start_date': '2019-10-22T07:12:36', 'block_num': 48649246}]
    (Background on this error at: http://sqlalche.me/e/14/gkpj) 
  • Bartek Wrona added 1 commit

    added 1 commit

    • b44b6b5e - Columns added via alter table should have also defined DEFAULT constrains to...

    Compare with previous version

  • Bartek Wrona enabled an automatic merge when the pipeline for b44b6b5e succeeds

    enabled an automatic merge when the pipeline for b44b6b5e succeeds

  • Bartek Wrona canceled the automatic merge

    canceled the automatic merge

  • Merging since test passed, just post-deploy phase failed due to strange error related to missing script.

  • merged

  • Bartek Wrona mentioned in commit 4837cf9f

    mentioned in commit 4837cf9f

Please register or sign in to reply
Loading