Skip to content

IGNITE-26646 Use MessageSerializer for PartitionUpdateCountersMessage#12402

Merged
shishkovilja merged 5 commits intoapache:masterfrom
chesnokoff:ignite-26646
Jan 20, 2026
Merged

IGNITE-26646 Use MessageSerializer for PartitionUpdateCountersMessage#12402
shishkovilja merged 5 commits intoapache:masterfrom
chesnokoff:ignite-26646

Conversation

@chesnokoff
Copy link
Contributor

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see TC.Bot: Check PR)

Notes

If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.

@chesnokoff chesnokoff force-pushed the ignite-26646 branch 2 times, most recently from 42034b2 to 3f54423 Compare November 27, 2025 11:11
@chesnokoff chesnokoff force-pushed the ignite-26646 branch 4 times, most recently from 2aac42e to 8bbcce0 Compare January 14, 2026 22:16
Comment on lines 68 to 69
if (data == null)
return new byte[0];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

IgniteIoCommunicationMessageSerializationTest#testMessageSerializationAndDeserializationConsistency fails without null check

Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the fact that data is initialized in the constructor and cannot be null, I suggest removing this check and adding to IgniteIoCommunicationMessageSerializationTest#initializeMessage:

        if (msg instanceof PartitionUpdateCountersMessage)
            FieldUtils.writeField(msg, "data", new byte[0], true);

*/
public void payload(byte[] payload) {
data = payload;
size = data == null ? 0 : data.length / ITEM_SIZE;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

IgniteCachePutGetRestartAbstractTest#testTxPutGetRestart fails without null check

Copy link
Contributor

Choose a reason for hiding this comment

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

MessageReader#readByteArray returns null when it couldn't fully extract the entire payload from the buffer because the complete byte array didn't fit into the read buffer.

Previously, we were setting the size after successfully reading the whole byte array using the reader.

In my opinion, the current logic seems fine.

@sonarqubecloud
Copy link

@shishkovilja shishkovilja merged commit 98bee6b into apache:master Jan 20, 2026
9 checks passed
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