Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-15399

Add ability to track state in repair

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      To enhance the visibility in repair, we should expose internal state via virtual tables; the state should include coordinator as well as participant state (validation, sync, etc.)

      I propose the following tables:

      repairs - high level summary of the global state of repair; this should be called on the coordinator.

      CREATE TABLE repairs (
        id uuid,
        keyspace_name text,
        table_names frozen<list<text>>,
        ranges frozen<list<text>>,
        coordinator text,
        participants frozen<list<text>>,
      
        state text,
        progress_percentage float,
        last_updated_at_millis bigint,
        duration_micro bigint,
        failure_cause text,
      
        PRIMARY KEY ( (id) )
      )
      

      repair_tasks - represents RepairJob and participants state. This will show if validations are running on participants and the progress they are making; this should be called on the coordinator.

      CREATE TABLE repair_tasks (
        id uuid,
        session_id uuid,
        keyspace_name text,
        table_name text,
        ranges frozen<list<text>>,
        coordinator text,
        participant text,
      
        state text,
        state_description text,
        progress_percentage float, -- between 0.0 and 100.0
        last_updated_at_millis bigint,
        duration_micro bigint,
        failure_cause text,
      
        PRIMARY KEY ( (id), session_id, table_name, participant )
      )
      

      repair_validations - shows the state of the validation task and updated periodically while validation is running; this should be called on the participants.

      CREATE TABLE repair_validations (
        id uuid,
        session_id uuid,
        ranges frozen<list<text>>,
        keyspace_name text,
        table_name text,
        initiator text,
        state text,
        progress_percentage float,
        queue_duration_ms bigint,
        runtime_duration_ms bigint,
        total_duration_ms bigint,
        estimated_partitions bigint,
        partitions_processed bigint,
        estimated_total_bytes bigint,
        failure_cause text,
      
        PRIMARY KEY ( (id), session_id, table_name )
      )
      

      The main reason for exposing virtual tables rather than exposing through durable tables is to make sure what is exposed is accurate. In cases of write failures or node failures, the durable tables could become in-accurate and could add edge cases where the repair is not running but the tables say it is; by relying on repair's internal in-memory bookkeeping, these problems go away.

      This jira does not try to solve the following:
      1) repair resiliency - there are edge cases where repair hits an error and runs forever (at least from nodetool's perspective).
      2) repair stream tracking - I have not learned the streaming side yet and what I see is multiple implementations exist, so seems like high scope. My hope is to punt from this jira and tackle separately.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dcapwell David Capwell Assign to me
            dcapwell David Capwell
            David Capwell
            Zhao Yang
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 26.5h
                26.5h

                Slack

                  Issue deployment