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

HDDS-10943. Freon DN Echo should skip writing payload to ratis log #6825

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jojochuang
Copy link
Contributor

What changes were proposed in this pull request?

HDDS-10943. Freon DN Echo should skip writing payload to ratis log

Please describe your PR in detail:
Echo request transaction payload is saved into ratis log. The payload isn't used and causes rapid ratis log rotation

What is the link to the Apache JIRA

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

How was this patch tested?

This is an optimization; no functional change. Plus, it doesn't look easy to write a unit test around ContainerStateMachine within the current framework.

@jojochuang jojochuang requested a review from szetszwo June 17, 2024 17:58
@kerneltime
Copy link
Contributor

Maybe the right solution is to have 2 payloads, one that gets written to the log which presents the size of the request proto but serialized and another the data payload which does not get replication via the log? Not sure what will get measure this way when the payload is dropped entirely.

@jojochuang
Copy link
Contributor Author

@kerneltime i want to do something similar to WriteChunk where the payload got sent to follower too.

@kerneltime
Copy link
Contributor

@kerneltime i want to do something similar to WriteChunk where the payload got sent to follower too.

Makes sense. Do you want this PR to still go forward?

@adoroszlai
Copy link
Contributor

/pending conflict

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Marking this issue as un-mergeable as requested.

Please use /ready comment when it's resolved.

Please note that the PR will be closed after 21 days of inactivity from now. (But can be re-opened anytime later...)

conflict

@szetszwo
Copy link
Contributor

@jojochuang , thanks for working on this! Sorry that I missed this pr earlier. The change looks good. Some minor suggestions

  • It is better to not building the intermediate protos since it may lead to more buffer copying.
  • Combine the short lines.
    } else if (proto.getCmdType() == Type.Echo) {
      final EchoRequestProto echo = proto.getEcho();
      // skipping the payload field so it doesn't get written to the ratis log
      protoBuilder.setEcho(EchoRequestProto.newBuilder(echo).clearPayload()).build();
    }

Change-Id: Ie2e184fbafca34546454d908c0d756e1ea3631be
@jojochuang
Copy link
Contributor Author

Hm I think this PR is wrong. It should do what's similar to WriteChunk, do not remove data at startTransaction() because that way, follower don't get the data. Instead, ContainerStateMachine should remove data in write() and put back data in read()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants