mirror of
https://github.com/minio/minio.git
synced 2025-04-04 11:50:36 -04:00
Temporary workaround for msgp skipping (#10960)
Due to https://github.com/philhofer/fwd/issues/20 when skipping a metadata entry that is >2048 bytes and the buffer is full (2048 bytes) the skip will fail with `io.ErrNoProgress`. Enlarge the buffer so we temporarily make this much more unlikely. If it still happens we will have to rewrite the skips to reads. Fixes #10959
This commit is contained in:
parent
6990de9c94
commit
a58b7874ef
@ -247,7 +247,9 @@ type metacacheReader struct {
|
|||||||
func newMetacacheReader(r io.Reader) (*metacacheReader, error) {
|
func newMetacacheReader(r io.Reader) (*metacacheReader, error) {
|
||||||
dec := s2DecPool.Get().(*s2.Reader)
|
dec := s2DecPool.Get().(*s2.Reader)
|
||||||
dec.Reset(r)
|
dec.Reset(r)
|
||||||
mr := msgp.NewReader(dec)
|
// TODO: Go back to default size when this fix is available:
|
||||||
|
// https://github.com/philhofer/fwd/issues/20
|
||||||
|
mr := msgp.NewReaderSize(dec, 64<<10)
|
||||||
m := metacacheReader{
|
m := metacacheReader{
|
||||||
mr: mr,
|
mr: mr,
|
||||||
closer: func() {
|
closer: func() {
|
||||||
@ -429,8 +431,8 @@ func (r *metacacheReader) forwardTo(s string) error {
|
|||||||
}
|
}
|
||||||
if string(tmp) >= s {
|
if string(tmp) >= s {
|
||||||
r.current.name = string(tmp)
|
r.current.name = string(tmp)
|
||||||
r.current.metadata, err = r.mr.ReadBytes(nil)
|
r.current.metadata, r.err = r.mr.ReadBytes(nil)
|
||||||
return err
|
return r.err
|
||||||
}
|
}
|
||||||
// Skip metadata
|
// Skip metadata
|
||||||
err = r.mr.Skip()
|
err = r.mr.Skip()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user