Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • H haf
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 35
    • Issues 35
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • hive
  • haf
  • Issues
  • #52
Closed
Open
Created Apr 29, 2022 by Mariusz@TrelaDeveloper

A context has `current_block_num` value greater than `irreversible_block` value

How to repeat?

  1. Prepare an empty database.
  2. CREATE EXTENSION hive_fork_manager CASCADE;
  3. SELECT hive.app_create_context( 'any_context' )
  4. SELECT hive.app_context_detach( 'any_context' )
  5. SELECT hive.app_context_attach( 'any_context', 1550 )

Now the context any_context has: current_block_num=1550 and irreversible_block=0.

Description

For SELECT * FROM hive.irreversible_data we have consistent_block=null, but in hive.app_context_attach we have a check

    IF _last_synced_block > __head_of_irreversible_block THEN
        RAISE EXCEPTION 'Cannot attach context % because the block num % is grater than top of irreversible block %'
            , _context, _last_synced_block,  __head_of_irreversible_block;
    END IF;

How to solve?

We have 2 options:

  • a) checking null in above condition
  • b) a first record in hive.irreversible_data should have consistent_block=0
Assignee
Assign to
Time tracking