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

feat: redundancy retrieve api #4529

Merged
merged 52 commits into from
Feb 7, 2024
Merged

Conversation

zelig
Copy link
Member

@zelig zelig commented Dec 21, 2023

the final push of non-local redundancy.
contains extensive joiner and bzz api tests to demonstrate the correctness of the various decoder prefetching strategies and to test header-based setting of paramater values.

The PR also contains many fixes:

  • remove langos and not use prebuffering on endoints
  • introduce fetchtimeout on decoder get calls
  • decoder to handle short final chunks on all levels
  • decoder defaults handling

UPDATE: the final push contains the following improvements:

  • put back Langos lookaheadbuffer and use it if redundancy level is 0 or when strategy is DATA for continuity of expectations (to be calibrated separately)
  • correct context and error handling in Get
  • decoding defaults defined within package but assigned by the API in case header undefined.
  • pseudorand moved ioutils->testutils

@nugaon nugaon changed the base branch from master to feat/redundancy December 21, 2023 10:19
@nugaon nugaon changed the title Feat/redundancy api tests feat: redundancy retrieve api Dec 21, 2023
@zelig zelig force-pushed the feat/redundancy-api-tests branch from ccb89ca to aefd316 Compare January 6, 2024 04:00
zelig added 26 commits January 6, 2024 08:17
Copy link
Member

@nugaon nugaon left a comment

Choose a reason for hiding this comment

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

all in all seems good for me though the tests fails.

pkg/api/bzz.go Outdated Show resolved Hide resolved
pkg/api/bzz_test.go Outdated Show resolved Hide resolved
pkg/api/bzz_test.go Show resolved Hide resolved
Comment on lines +108 to +110
if levels == 1 {
forget = 2
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this part. why is it 2?

Comment on lines +113 to +115
for j := 2; j < levels; j++ {
gap *= shardCnt
}
Copy link
Member

Choose a reason for hiding this comment

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

at line 209 you define only {1, 2, 3} for levels, so this basically takes into action for 3 only. I also do not really understand why it is necessary.


// GetLevelFromContext is a helper function to extract the redundancy level from the context
func GetLevelFromContext(ctx context.Context) Level {
rlevel := PARANOID
Copy link
Member

Choose a reason for hiding this comment

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

this only regards to the dispersed replica lookup, maybe its documentation could be amended.

// New creates a new pseudorandom reader seeded with the given seed.
func NewReader(seed []byte, l int) *Reader {
r := &Reader{len: l}
_ = copy(r.buf[8:], seed)
Copy link
Member

Choose a reason for hiding this comment

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

why is the first 8 byte left out?

pkg/file/redundancy/getter/getter.go Show resolved Hide resolved
}
bufSegments := bufSize / 32
start := r.cur / bufSegments
rem := (r.cur % bufSize) / 32
Copy link
Member

Choose a reason for hiding this comment

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

first it is devided by 32 then you multiply it by that. it is not necessary

@zelig zelig force-pushed the feat/redundancy-api-tests branch from 1e0b0e9 to 218fe7e Compare January 20, 2024 02:13
@nugaon
Copy link
Member

nugaon commented Jan 20, 2024

Overall, I think we should keep some pre-fetching mechanism for case when the data is not erasure coded. Without that, data retrieval may be really slow.

@zelig zelig force-pushed the feat/redundancy-api-tests branch from 3660deb to 3a47dc6 Compare January 25, 2024 16:00
@zelig zelig force-pushed the feat/redundancy-api-tests branch 3 times, most recently from dcb5ae6 to 56754cb Compare February 4, 2024 06:12
@zelig zelig force-pushed the feat/redundancy-api-tests branch from 56754cb to 969a134 Compare February 4, 2024 06:40
@notanatol notanatol requested review from notanatol and removed request for mrekucci February 4, 2024 22:27
@zelig zelig merged commit e3d4d5a into feat/redundancy Feb 7, 2024
12 checks passed
@zelig zelig deleted the feat/redundancy-api-tests branch February 7, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants