Skip to content

HDDS-7619. Update SCM term in datanode when command is received#4072

Merged
sodonnel merged 6 commits intoapache:masterfrom
adoroszlai:HDDS-7619
Dec 13, 2022
Merged

HDDS-7619. Update SCM term in datanode when command is received#4072
sodonnel merged 6 commits intoapache:masterfrom
adoroszlai:HDDS-7619

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Update datanode's record of "SCM leader term" as soon as command is added to the queue to help drop obsolete commands sooner.

https://issues.apache.org/jira/browse/HDDS-7619

How was this patch tested?

Added unit test.

https://github.com/adoroszlai/hadoop-ozone/actions/runs/3677335765

@adoroszlai adoroszlai self-assigned this Dec 12, 2022
Copy link
Contributor

@siddhantsangwan siddhantsangwan left a comment

Choose a reason for hiding this comment

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

@adoroszlai The changes look good to me!

@siddhantsangwan
Copy link
Contributor

Do we have multiple threads adding and getting commands from the command queue?
Checking the usages of getNextCommand(), it seems we only have a single thread getting commands right now:

    /**
     * Task that periodically checks if we have any outstanding commands.
     * It is assumed that commands can be processed slowly and in order.
     * This assumption might change in future. Right now due to this assumption
     * we have single command  queue process thread.
     */

Even if we have multiple threads, I don't think there are any potential problems related to multithreaded inconsistency in the new code. I'm asking for better understanding.

Copy link
Contributor

@sodonnel sodonnel left a comment

Choose a reason for hiding this comment

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

LGTM

@sodonnel sodonnel merged commit d6f63bf into apache:master Dec 13, 2022
@adoroszlai
Copy link
Contributor Author

Thanks @siddhantsangwan, @sodonnel for the review.

@adoroszlai adoroszlai deleted the HDDS-7619 branch December 13, 2022 15:28
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.

3 participants