Skip to content

Rule ID counter will be reset after restarting Sentinel dashboard #358

@foreveryang321

Description

@foreveryang321

Issue Description

bug report

public class InMemFlowRuleStore extends InMemoryRuleRepositoryAdapter<FlowRuleEntity> {

    private static AtomicLong ids = new AtomicLong(0);

    @Override
    protected long nextId() {
        return ids.incrementAndGet();
    }
...

当规则持久化到zk、Nacos时,重启控制台后,Id 生成器会从 1 开始,会导致新建规则覆盖掉旧规则的情况

Translated from Google:
When the rule is persisted to zk, Nacos, after restarting the console, the Id generator will start at 1 and cause the new rule to overwrite the old rule.

Tell us your environment

sentinel-dashboard 1.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dashboardIssues or PRs about Sentinel Dashboard

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions