Skip to content

[branch-1.2](bug) Fix revise tablet causes replica_id is 0 in tablet meta in version 1.2#25728

Merged
lide-reed merged 2 commits intoapache:branch-1.2-ltsfrom
xy720:fix-replica-id-is-0
Oct 25, 2023
Merged

[branch-1.2](bug) Fix revise tablet causes replica_id is 0 in tablet meta in version 1.2#25728
lide-reed merged 2 commits intoapache:branch-1.2-ltsfrom
xy720:fix-replica-id-is-0

Conversation

@xy720
Copy link
Member

@xy720 xy720 commented Oct 23, 2023

Proposed changes

How to reproduce: #25864

In version 1.2, We have found a lot of tablets with replica_id which is 0 in its tablet meta, just like:

{
    "table_id": 4882109,
    "partition_id": 4882108,
    "tablet_id": 6701853,
    "schema_hash": 2015010729,
    "shard_id": 4,
    "creation_time": 1688004194,
    "cumulative_layer_point": -1,
    "tablet_state": "PB_RUNNING",
    "schema": {
        "keys_type": "UNIQUE_KEYS",
        "column": [
                  ...
         ],
        "num_short_key_columns": 1,
        "num_rows_per_row_block": 1024,
        "compress_kind": "COMPRESS_LZ4",
        "next_column_unique_id": 87,
        "is_in_memory": false,
        "delete_sign_idx": 86,
        "sequence_col_idx": -1,
        "sort_type": "LEXICAL",
        "sort_col_num": 0,
        "compression_type": "LZ4F",
        "schema_version": 0,
        "disable_auto_compaction": false,
        "version_col_idx": -1
    },
    "rs_metas": [
               ...
     ],
    "replica_id": 0,
    "storage_policy": "",
    "enable_unique_key_merge_on_write": false
}

And I found that all these tablets was cloned from other backends.

image

Here is why:

In #6814, it use copy constructor TabletMeta::TabletMeta(const TabletMeta& b) in revise_tablet_meta method.

And in #9971, it introduce replica_id into tablet meta, but forgot to update TabletMeta::TabletMeta(const TabletMeta& b) to set replica_id

So clone task which call revise_tablet_meta may cause replica_id in tablet meta to 0.

When Fe submit a drop tablet task to Be, we will find a lot of WARNING LOG like:

image

This is because the replica_id in tablet meta is already set to 0.

Besides, in master branch, the TabletMeta::TabletMeta(const TabletMeta& b) is not used any more.

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@xy720 xy720 changed the title [branch-1.2](bug) Fix revise tablet causes replica_id is 0 in BE tablet meta [branch-1.2](bug) Fix revise tablet causes replica_id is 0 in tablet meta in version 1.2 Oct 23, 2023
Copy link
Contributor

@lide-reed lide-reed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Oct 25, 2023
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@lide-reed lide-reed merged commit 2159a71 into apache:branch-1.2-lts Oct 25, 2023
GoGoWen pushed a commit to GoGoWen/incubator-doris that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/1.2.8-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants