Skip to content

Conversation

@benoit-a
Copy link
Collaborator

@benoit-a benoit-a commented Apr 3, 2025

This pull request includes several changes to the backend.go file and related test files to improve encoding and decoding functionality, add new tests, and introduce a new format for buffer matrices. The most important changes include the addition of a new format for buffer matrices, improvements to the encoding and decoding processes, and the addition of new tests to ensure compatibility and correctness.

- Improves last stripe efficiency.
- Adds new BufferMatrix format.
- Fixes edge cases in last stripe.
- Keeps compatibility with old format.
This commit adds tests and fixes to allow reading data ranges correctly
from both old and new formats of erasure-coded data. It ensures correct
fragment selection and decoding for range reads in both formats.
- Annotate origDataSize check with //nolint:gosec after review
- Rename `backendId` to `backendID` for Go conventions
@bert-e
Copy link

bert-e commented Apr 3, 2025

Hello benoit-a,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link

bert-e commented Apr 3, 2025

Conflict

There is a conflict between your branch bugfix/study_1 and the
destination branch development/1.0.

Please resolve the conflict on the feature branch (bugfix/study_1).

git fetch && \
git checkout origin/bugfix/study_1 && \
git merge origin/development/1.0

Resolve merge conflicts and commit

git push origin HEAD:bugfix/study_1

@benoit-a benoit-a requested a review from Copilot April 3, 2025 07:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request implements Option 1.5 by enhancing the encoding/decoding functionality, introducing a new buffer matrix format, and adding comprehensive tests to validate these changes. Key updates include:

  • New tests and methods to support the new buffer matrix format.
  • Improvements to offset calculation and fragment length handling in buffer.go.
  • Adjustments in encoding routines and range matrix tests to support both old and new formats.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
buffer_test.go Added new test functions (TestBufferNew, TestGetOffsetNew, etc.) for validating new format
buffer.go Modified BufferMatrix to support a new format alongside improved offset and header management
backend_test.go Introduced tests to check compatibility between old and new formats and range matrix correctness
backend.go Updated encoding routines (chunk preparation, fragment handling) to work with new buffer format

// do the true encoding according the backend used (isa-l, cauchy ....)
ret = ec->common.ops->encode(ec->desc.backend_desc, k_ref, m_ref, ctx->chunk_size);
// chunksize is the size of fragmenets in the stripe

Choose a reason for hiding this comment

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

Suggested change
// chunksize is the size of fragmenets in the stripe
// chunksize is the size of fragments in the stripe

// If we are at the end of the data, we may have a smaller
// fragment than the others. fraglen will take of that.
int size = datalen - ((nth * ctx->k * ctx->chunk_size) + (i * fraglen));
tot_len_sum += size > 0 ? (size > fraglen ? fraglen : size) : 0;

Choose a reason for hiding this comment

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

is there some cases where fraglent can be lower than 0 ?
otherwise, it could be simplified ?

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.

4 participants