Repository navigation
Description
1. Symptom
Blanking the K8s namespace, K8s ID or description of a NameServer registry entry has no effect. In the Studio cluster page's registry edit dialog, clearing one of those fields and saving reports success and reloads the list, and the previous value is back in the row.
2. Root cause
server/src/main/java/org/apache/rocketmq/studio/cluster/nameserver/NameserverRegistryService.java:79-85
entity.setName(name);
entity.setNamesrvAddr(NamesrvAddrParser.normalize(command.getNamesrvAddr()));
entity.setK8sNamespace(command.getK8sNamespace());
entity.setK8sId(command.getK8sId());
entity.setDescription(command.getDescription());
...
int updated = nameserverMapper.updateById(entity);The update request replaces every editable field of the entry - UpdateNameserverRegistryDTO.name and .namesrvAddr are @NotBlank (UpdateNameserverRegistryDTO.java:35-41), and the three optional columns are copied unconditionally - so the service's contract is "the stored entry matches the request".
Two things then line up to lose the clear:
- The edit dialog submits a blanked optional field as an absent one:
web/src/pages/cluster/index.tsx:255-257builds the payload withk8sNamespace: values.k8sNamespace || undefined,k8sId: values.k8sId || undefinedanddescription: values.description || undefined, socommand.getDescription()etc. arenullafter a field is cleared. - MyBatis-Plus
updateByIdomits null entity fields (FieldStrategy.NOT_NULL; there is noupdate-strategyoverride inapplication.yml), so those three columns are dropped from the SET clause and keep their previous values.
Clearing is therefore unreachable through the API: null means "leave the column alone" (accidentally), and there is no separate clear flag, unlike clearApiKey in general settings. The same mechanism was already documented and fixed for the ACL user/rule columns in #3342.
3. Impact
- The registry entry's annotations are write-once: an operator can add or change a K8s namespace / K8s ID / description but cannot remove it, which is exactly what is needed when an entry is re-pointed at a non-K8s deployment or a stale
k8sIdhas to be dropped. - The API response and the reloaded list disagree with the write: the save reports success,
updatere-reads the row and returns the retained value, and the dialog then shows the old text again with no error. k8s_idlinks a registry entry to its K8s certificate view, so a stale one cannot be cleaned up from the UI.
4. Reproduction
- Create a registry entry with
k8sNamespace = "rocketmq1",k8sId = "k8s-1",description = "community chart cluster". - Edit it and clear the description (leave name and namesrvAddr untouched), save.
- Effect: HTTP 200, list reloads, the description is still
community chart cluster. SELECT k8s_namespace, k8s_id, description FROM rmq_nameserver WHERE id = <id>confirms the columns were not updated.
5. Expected behaviour
- The stored entry matches the submitted request: an optional field the request does not carry is persisted as NULL for that entry, and a field the request does carry is written as submitted.
- No signature or DTO change is required;
updateByIdstays for the non-null columns, the cleared ones are assigned explicitly.
Activity
RockteMQ-AI commentedon Sep 13, 2026
Issue Evaluation
Category:
bug| Status: ConfirmedThank you for the thorough analysis. The root cause has been verified against the codebase:
Root Cause: The frontend serializes blanked optional fields as
undefined(→nullon the backend), and MyBatis-PlusupdateByIdwithFieldStrategy.NOT_NULLsilently omits null fields from theSETclause. This makes clearingk8sNamespace,k8sId, ordescriptionunreachable through the UI.Impact: Registry entry annotations become write-once. Operators cannot remove stale K8s references or descriptions when re-pointing entries.
Severity: Medium — functional defect with a clear workaround (delete and re-create the entry), but the silent failure is confusing.
Fix direction: Either (a) use an explicit clear mechanism (similar to
clearApiKeyin general settings, as you noted), or (b) switch the update strategy for these optional fields toFieldStrategy.ALWAYS/ useUpdateWrapperwith explicit.set(column, null). The precedent from #3342 (ACL columns) suggests approach (b) is consistent with existing patterns.An automated fix proposal may be generated. Reply
/approveto proceed with PR generation, or provide additional context if needed.Automated evaluation by github-manager
RockteMQ-AI commentedon Sep 13, 2026
Issue Evaluation
Category:
type/bug| Status: ConfirmedThe issue is valid. When blanking a NameServer registry entry's description, k8s namespace, or k8s id, the save API reports success but the previous value persists. This is likely caused by the backend treating empty strings as "no change" during the update, or by the frontend sending
null/empty values that the backend ignores.The fix should ensure that empty string values are properly persisted as updates, not treated as "skip this field."
Automated evaluation by github-manager
github-actions commentedon Sep 21, 2026
This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.
fix(studio): persist cleared optional instance and registry fields
lizhimins commentedon Sep 21, 2026
Resolved by #4466, merged into
rocketmq-studioas f759510.NameserverRegistryService.updatenow callsclearOmittedOptionalColumns, which assigns the k8s namespace, k8s id and description columns explicitly when the request omits them, so blanking one of those fields actually clears it. Reopening and closing as completed because the stale bot had auto-closed this as not planned.