Skip to content

feat(dashmate): refactor reindex behaviour #788

Closed

Description

@pshenmic

Expected Behavior

Reindex command should not change the config and ask user for additional command executions. Instead, command arguments should be used to turn local dashcore container into reindex mode. You don't actually need to edit any dashmate or dashcore configs.

Current Behavior

Reindex command actually changes dashmate config and re-renders all the configs.

Possible Solution

As a more redundant solution, we can use a normal running node to the reindex process and just keep it running when reindex is finished. It will keep Dashmate architecture simpler and we won't need to keep reindex state.

Two commands should be updated:

Reindex command

  1. if the Core service is started we need to inform a user that during reindexing the node won't operate for some time. Core should be stopped.
  2. Write reindex=1 into the Core config
  3. Start the Core service
  4. When Core service is started we update the Core config again and remove reindex flag
  5. If --detach flag is not passed, we show the progress and estimation in reindex command output. The command should exit when reindex is done. We also should warn users that they can exit from the command (CTRL - C) and the process will continue in the background. In both cases, we should tell users that can monitor the process with dashmate status core command.

Dashmate status

Add sync/reindex estimation to dashmate status and dashmate status core
Possibly to detect that reindex is required and show an error with suggestion to run reindex command

Alternatives Considered

Build a statfull soltuion with background reindexing but it will overcomplectate the system and require much more work which doesn't give much benefits

Additional Context

Activity

  1. added
    enhancement
    on Feb 17, 2023
  2. self-assigned this
    on Mar 11, 2023
  3. added this to the v0.24.0 milestone on Mar 15, 2023
  4. modified the milestones: v0.24.0, v0.25.0 on May 10, 2023
  5. pshenmic commented on Jul 22, 2023

    @pshenmic
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions