tikv / tikv/pd

rm: make controller config metadata update atomic

Open
#10,335 0 comments 0 reactions 0 assignees View on GitHub
component/mcs type/development
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Development Task

Follow-up from PR #10246 review discussion: https://github.com/tikv/pd/pull/10246#discussion_r2916242575

Background:
`POST /resource-manager/api/v1/config/controller` currently validates controller-config keys before applying updates, but value/type validation and persistence still happen one field at a time through `UpdateControllerConfigItem`. If a request mixes one valid field with another invalid field, an earlier field may already have been persisted before the API returns `400`.

This means the API is not fully all-or-nothing from the caller's perspective, even though the current test naming and review discussion expect atomic behavior.

This task is split out from PR #10246 as a follow-up instead of blocking that PR.

Expected work:
- make controller config metadata updates atomic from the API perspective
- avoid partial persistence when one field in a multi-field request is invalid
- add regression coverage for mixed valid/invalid payloads, such as a valid boolean field plus an invalid duration value

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.