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

Fix GetReadVersionReply.recentRequests to reflect a proxy's number of recent requests in the commit stats. #3377

Merged
merged 1 commit into from Jun 23, 2020

Conversation

yangliu1333
Copy link

@yangliu1333 yangliu1333 commented Jun 17, 2020

This is a bug I found when working on #3307 and decide to make the change a patch against 6.3.

  • The problem is that GetReadVersionReply.recentRequests should always reflect the serving proxy's number of recent requests. Currently we may override it with other proxy's reply which is always 0 [1].

[1] https://github.com/apple/foundationdb/blob/master/fdbserver/MasterProxyServer.actor.cpp#L2086


for (auto v : versions) {
if(v.version > rep.version) {
rep = v;
}
}
rep.recentRequests = commitData->stats.getRecentRequests();
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like the change is moving this line to here after the for loop. What’s the problem it fixes?

Copy link
Author

Choose a reason for hiding this comment

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

It seems that I cannot configure the reviewer to review the PR. Can you help add Evan into this since I have synced with him about this offline.

Copy link
Author

Choose a reason for hiding this comment

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

Have updated the PR description, thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see the problem.

@@ -1411,13 +1411,13 @@ ACTOR Future<GetReadVersionReply> getLiveCommittedVersion(ProxyCommitData* commi
rep.version = commitData->committedVersion.get();
Copy link
Contributor

Choose a reason for hiding this comment

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

won't these assignments be override in the following for() loop for the same reason?
Why don't we move them below the for loop?

Copy link
Author

Choose a reason for hiding this comment

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

I think these are fine because they are supposed to overridden when other proxy has a larger version and it's 'locked' and 'metadataVersion' is more up-to-date.

@yangliu1333 yangliu1333 marked this pull request as ready for review June 17, 2020 19:34
@yangliu1333
Copy link
Author

20200616-233150-apple::PR_3377-52c19f9284c793c3 correctness run passed with previous known errors.

@etschannen etschannen merged commit 0000d81 into apple:release-6.3 Jun 23, 2020
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.

None yet

4 participants