Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more logging message to monitor branch token update #5058

Merged
merged 6 commits into from
Oct 31, 2023

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Oct 31, 2023

What changed?
Add more logging message to monitor branch token update

Why?
better debugging.

How did you test it?
only logging.

Potential risks

Is hotfix candidate?

@yux0 yux0 requested a review from yycptt October 31, 2023 21:53
@yux0 yux0 requested a review from a team as a code owner October 31, 2023 21:53
service/history/api/get_workflow_util.go Outdated Show resolved Hide resolved
@@ -121,6 +127,10 @@ func GetOrPollMutableState(
return nil, err
}
if !versionhistory.ContainsVersionHistoryItem(currentVersionHistory, request.VersionHistoryItem) {
logger.Warn("Request history branch and current history branch are mismatched prior to poll the mutable state.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logger.Warn("Request history branch and current history branch are mismatched prior to poll the mutable state.",
logger.Warn("Request history branch and current history branch don't match prior to polling the mutable state",

service/history/api/get_workflow_util.go Outdated Show resolved Hide resolved
@@ -94,6 +96,10 @@ func GetOrPollMutableState(
// We return the full version histories. Callers need to fetch the last version history item from current branch
// and use the last version history item in following calls.
if !versionhistory.ContainsVersionHistoryItem(currentVersionHistory, request.VersionHistoryItem) {
logger.Warn("Request history branch and current history branch are mismatched.",
tag.Value(currentVersionHistory),
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know much about this yet; is currentVersionHistory safe to log? Safe in terms of (a) security, (b) size and (c) performance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

change to log the last item. The length is fixed.

yux0 and others added 3 commits October 31, 2023 15:13
Co-authored-by: Stephan Behnke <stephanos@users.noreply.github.com>
Co-authored-by: Stephan Behnke <stephanos@users.noreply.github.com>
Copy link
Contributor

@stephanos stephanos left a comment

Choose a reason for hiding this comment

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

1 of the 3 messages hasn't been updated yet

service/history/api/get_workflow_util.go Outdated Show resolved Hide resolved
Co-authored-by: Stephan Behnke <stephanos@users.noreply.github.com>
@yux0 yux0 enabled auto-merge (squash) October 31, 2023 22:34
@yux0 yux0 merged commit 471fdb3 into temporalio:main Oct 31, 2023
8 checks passed
@yux0 yux0 deleted the logging-branch-token branch October 31, 2023 23:19
yux0 added a commit that referenced this pull request Nov 21, 2023
<!-- Describe what has changed in this PR -->
**What changed?**
Add more logging message to monitor branch token update

<!-- Tell your future self why have you made these changes -->
**Why?**
better debugging.

<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
**How did you test it?**
only logging.

<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
**Potential risks**


<!-- Is this PR a hotfix candidate or require that a notification be
sent to the broader community? (Yes/No) -->
**Is hotfix candidate?**

---------

Co-authored-by: Stephan Behnke <stephanos@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants