Skip to content

在 AppNamespace 进行快速删除并重建的操作场景中,AppNamespaceServiceWithCache 类在执行缓存清理时存在缺陷,会导致误删缓存key的问题 #5502

Description

@hezhaoye

描述bug

在 AppNamespace 进行快速删除并重建的操作场景中,AppNamespaceServiceWithCache 类在执行缓存清理时存在缺陷,会导致误删缓存key的问题,导致format字段判断不准

复现

通过如下步骤可以复现:

  1. 管理员在Apollo管理员后台执行删除AppNamespace操作
  2. 用户立马在Apollo应用里面重新创建同名namespace(时间间隔低于1分钟)
  3. AppNamespaceServiceWithCache类在扫描清理过期key是60秒执行1次,这样子导致的结果就是,scanNewAppNamespaces()是每秒执行会快速的扫描ID到cache中,而updateAndDeleteCache()是每60秒执行1次,当执行删除操作时,会找到旧ID对应的appId+appNamespace进而删除,导致cache数据没了。而新创建的appNamespace因为之前已经快速扫描过了,不会再扫描了,导致bug出现。(如果重建时间间隔大于1分钟就正常)

期望

在1分钟内重建appNamespace,缓存也能正常识别生效。

截图

Image

Metadata

Metadata

Assignees

Labels

area/configserviceapollo-configservicebugCategorizes issue or PR as related to a bug.good first issuegood first issue Good for beginners

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions