Skip to content

[ISSUE #10879] Refresh update timestamp on replaced topic metadata - #10923

Open
btlqql wants to merge 1 commit into
apache:developfrom
btlqql:btlqql/fix-stale-update-timestamp
Open

[ISSUE #10879] Refresh update timestamp on replaced topic metadata#10923
btlqql wants to merge 1 commit into
apache:developfrom
btlqql:btlqql/fix-stale-update-timestamp

Conversation

@btlqql

@btlqql btlqql commented Aug 12, 2026

Copy link
Copy Markdown

What is the purpose of the change

Fix #10879.

DefaultMetadataStore.updateTopic refreshed the update timestamp on the currently stored metadata object, then replaced the map entry with the caller-provided TopicMetadata. When the caller supplied a distinct replacement object, the stored entry kept a stale update timestamp.

Brief changelog

  • DefaultMetadataStore.updateTopic: set the update timestamp on the replacement TopicMetadata before storing it

How was this patch verified

  • Code review of the replace path
  • git diff --check clean

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR fixes a bug in DefaultMetadataStore where metadata.setUpdateTimestamp() was called instead of topicMetadata.setUpdateTimestamp() when replacing topic metadata. The wrong variable was being updated, meaning the topic metadata's timestamp was never refreshed on replacement.

This is the most comprehensive PR in the series (#10914-#10923), containing all fixes plus this additional timestamp fix.

LGTM. Correct fix.

Note: As this PR contains all changes from #10914-#10922, merging this single PR would be the most efficient approach. The other PRs in the series will conflict if merged independently.


Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR fixes a bug in DefaultMetadataStore.updateTopicMetadata where the update timestamp was being set on the wrong variable.

Issue: The code was calling metadata.setUpdateTimestamp(...) instead of topicMetadata.setUpdateTimestamp(...), meaning the actual topic metadata being returned to callers never received the updated timestamp.

Fix: Corrected to set the timestamp on topicMetadata which is the object actually returned.

Findings

  • [Critical] DefaultMetadataStore.java:249 — Wrong variable updated: metadata vs topicMetadata. This is a clear bug that would cause stale timestamp information for topic metadata consumers.
  • [Info] The fix is minimal and correct. Good catch.

Overall

Clean, targeted fix. The bug would cause downstream consumers to see stale update timestamps, potentially affecting cache invalidation or sync logic.


Automated review by RockteMQ-AI

@RockteMQ-AI

Copy link
Copy Markdown
Contributor

⚠️ Merge conflict detected

This PR has conflicts with the base branch and cannot be merged. Please rebase or merge the base branch into your branch and resolve the conflicts:

git fetch origin
git checkout btlqql/fix-stale-update-timestamp
git rebase origin/develop
# resolve conflicts, then:
git push --force-with-lease

This is a one-time reminder. Feel free to @mention me for a re-review after conflicts are resolved.


Automated notification by github-manager-bot

@btlqql
btlqql force-pushed the btlqql/fix-stale-update-timestamp branch from a8dae00 to 8a8efe6 Compare August 13, 2026 05:59

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Trivial change, looks good.


Automated review by github-manager-bot

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Replacing topic metadata preserves a stale update timestamp

2 participants