Skip to content

[Bug] (balance) replica_id is 0 in tablet meta after clone to existed tablet in version 1.2 #25864

@xy720

Description

@xy720

Search before asking

  • I had searched in the issues and found no similar issues.

Version

1.2.7

What's Wrong?

replica_id is set to 0 in tablet meta, and it failed the drop task.

I1025 03:19:18.495761 586980 tablet_manager.cpp:452] begin drop tablet. tablet_id=10013, replica_id=10080
W1025 03:19:18.495775 586980 tablet_manager.cpp:465] fail to drop tablet because replica id not match. tablet_id=10013, replica_id=0, req
uest replica_id=10080
W1025 03:19:18.495801 586980 task_worker_pool.cpp:415] failed to drop tablet|signature=10013|tablet_id=10013|error=[ABORTED]aborted

What You Expected?

replica_id should not be 0

How to Reproduce?

1、create table with 3 replica

CREATE TABLE `table_test` (
  `k1` tinyint(4) NULL,
  `k2` decimal(10, 2) NULL DEFAULT "10.5",
  `k3` char(10) NULL COMMENT 'string column',
  `k4` int(11) NOT NULL DEFAULT "1" COMMENT 'int column'
) ENGINE=OLAP
DUPLICATE KEY(`k1`, `k2`, `k3`)
DISTRIBUTED BY HASH(`k1`) BUCKETS 8
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"in_memory" = "false",
"storage_format" = "V2",
"disable_auto_compaction" = "false"
);

2、choose one tablet of this table to reproduce this bug. (for example, tablet id is 10013)

3、stop the backend with one of this 10013's replica

4、insert some data into table, so that the replica in the stopped backend will have missing version.

insert into table_test values(1, 1.0, 'a', 1);
insert into table_test values(2, 1.0, 'b', 2);

5、start the backend, now tablet 10013 has missing version in this backend

5、wait for FE submit a clone task to clone the health replica to the version incomplete replica.

6、after the clone task is done, use curl http://xxxx.xxxx.xxxx:8040/api/meta/header/10013 to see the tablet meta in this backend.

7、you can see the replica id in tablet meta is 0

{
    "table_id": 10011,
    "partition_id": 10010,
    "tablet_id": 10013,
    "schema_hash": 2005446276,
    "shard_id": 8,
    "creation_time": 1697531714,
    "cumulative_layer_point": -1,
    "tablet_state": "PB_RUNNING",
    "schema": {
        "keys_type": "DUP_KEYS",
        "column": [
            ...
        ],
        "num_short_key_columns": 3,
        "num_rows_per_row_block": 1024,
        "compress_kind": "COMPRESS_LZ4",
        "next_column_unique_id": 4,
        "is_in_memory": false,
        "delete_sign_idx": -1,
        "sequence_col_idx": -1,
        "sort_type": "LEXICAL",
        "sort_col_num": 3,
        "compression_type": "LZ4F",
        "schema_version": 0,
        "disable_auto_compaction": false,
        "version_col_idx": -1
    },
    "rs_metas": [
        ...
    ],
    "in_restore_mode": false,
    "tablet_uid": {
        "hi": -7833000891113273950,
        "lo": -3019341299083636323
    },
    "preferred_rowset_type": "BETA_ROWSET",
    "tablet_type": "TABLET_TYPE_DISK",
    "replica_id": 0,
    "storage_policy": "",
    "enable_unique_key_merge_on_write": false
}

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions