Skip to content

【Advice】When the number of BE is less than 3, default replica_num should be setted to the number of BE #4757

Open
@xinghuayu007

Description

Describe the bug
When the number of BE is less than 3, create a table will set default replica_num to 3, which will cause creating a table failed. It is better to set default replica_num to the numbe of alive BE, when the numbe of BE is less than 3 and the param "replica_num" is not setted。

To Reproduce
Steps to reproduce the behavior:

  1. only add one BE to the system
  2. create a table, replica_num is not setted:

CREATE TABLE table4 ( siteid INT DEFAULT '10', citycode SMALLINT, username VARCHAR(32) DEFAULT '', pv BIGINT SUM DEFAULT '0' ) AGGREGATE KEY(siteid, citycode, username) DISTRIBUTED BY HASH(siteid) BUCKETS 10;

  1. See error
    ERROR 1064 (HY000): errCode = 2, detailMessage = Failed to find enough host in all backends. need: 3
    2020-10-19 11-15-58屏幕截图

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-reviewCategorizes an issue or PR as actively needing an API review.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions