Skip to content

Commit

Permalink
v2.115.15
Browse files Browse the repository at this point in the history
  • Loading branch information
flowzone-app[bot] authored Jun 28, 2023
1 parent 7e93dab commit 941fef9
Show file tree
Hide file tree
Showing 3 changed files with 283 additions and 1 deletion.
229 changes: 229 additions & 0 deletions .versionbot/CHANGELOG.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,232 @@
- commits:
- subject: Update layers/meta-balena to c2e6ca9d57fd7214fe7c078591741a9c0fa6de73
hash: bf749bf23b1dd51acbf3449be2168c8185b88c6b
body: Update layers/meta-balena
footer:
Changelog-entry: Update layers/meta-balena to c2e6ca9d57fd7214fe7c078591741a9c0fa6de73
changelog-entry: Update layers/meta-balena to c2e6ca9d57fd7214fe7c078591741a9c0fa6de73
author: Self-hosted Renovate Bot
nested:
- commits:
- subject: Update balena-engine to v20.10.37
hash: c607d7be4d740802ab5e27b67f5e6714e1407855
body: |
Update balena-engine from 20.10.36 to 20.10.37
footer:
Change-type: patch
change-type: patch
author: Self-hosted Renovate Bot
nested:
- commits:
- subject: "Bugfix: concatReadSeekCloser.Read() with buffers of any size"
hash: 84471473ce02a0b8820e13105f845b67c19903c9
body: >
Previously, `concatReadSeekCloser.Read()` would
incorrectly return

an `io.ErrUnexpectedEOF` if the last read from the second concatenated

`Reader` didn't completely fill the passed buffer.


For instance:


```
First Reader Second Reader
|aaaaaaaaaaaaa|bbbbbbbbbbbbbbbbbbb| <--- concatReadSeekCloser
|--- previously read ---|--- buffer ---| <--- last read
|xxxx| <--- "excess" buffer
```


In this example, we have a `concatReadSeekCloser` that concatenates two

`Reader`s (`aaa...` and `bbb...`). The last `Read()` used a buffer

larger than the yet-to-be-read portion of the `bbb...`. So, it would

incorrectly return an `io.ErrUnexpectedEOF`.


This commit makes sure that last `Read()` returns all the remaining data

without an error. It also adds various test cases for

`concatReadSeekCloser.Read()`, many of which would fail before this

correction.


Interestingly, this bug was silently affecting us. Not in a fatal way,

but causing deltas to be larger than necessary. Indeed, running

`TestDeltaSize` after this commit shows that some test cases are

producing deltas smaller than what we expected before. For posterity,

see all the details below.


We use `concatReadSeekCloser`s to concatenate all layers of the basis

image when creating the "signature" of the basis image. In this process,

the `concatReadSeekCloser`s are wrapped around by a buffered reader with

a buffer of 65kB.


If, in any read, part of this 65kB buffer was beyond the second

concatenated reader, it would result in an `io.ErrUnexpectedEOF`. This

would not cause the whole process to fail, but would prematurely end the

signature generation: some of the final blocks in the basis image would

not be added to the signature. Therefore, if those blocks appeared in

the target image, they'd result in (larger) LITERAL, instead of

(smaller) COPY operations.


For illustration, here's the delta generated for the `delta-006-008`

test case. First before this commit:


```
OP_COPY_N1_N2 0 512
OP_COPY_N2_N2 1536 1024
OP_COPY_N2_N2 3584 1024
OP_COPY_N2_N2 5632 1536
OP_COPY_N2_N2 8192 1536
OP_COPY_N2_N2 10752 4096
OP_COPY_N2_N2 15872 8704
OP_COPY_N2_N2 25600 10752
OP_COPY_N2_N2 37376 10752
OP_COPY_N2_N4 49152 131584
OP_COPY_N4_N4 181760 150528
OP_COPY_N4_N4 333312 500736
OP_COPY_N4_N4 835072 1000960
OP_COPY_N4_N4 1837056 1000960
OP_COPY_N4_N4 2839040 1027584 # Here: a COPY op...
OP_LITERAL_N2 21504 # ...followed by a 21 kB LITERAL.
OP_COPY_N4_N2 2838528 512
OP_COPY_N4_N2 2838528 512
OP_END
```


And after this commit:


```
OP_COPY_N1_N2 0 512
OP_COPY_N2_N2 1536 1024
OP_COPY_N2_N2 3584 1024
OP_COPY_N2_N2 5632 1536
OP_COPY_N2_N2 8192 1536
OP_COPY_N2_N2 10752 4096
OP_COPY_N2_N2 15872 8704
OP_COPY_N2_N2 25600 10752
OP_COPY_N2_N2 37376 10752
OP_COPY_N2_N4 49152 131584
OP_COPY_N4_N4 181760 150528
OP_COPY_N4_N4 333312 500736
OP_COPY_N4_N4 835072 1000960
OP_COPY_N4_N4 1837056 1000960
OP_COPY_N4_N4 2839040 1049088 # COPY only, since we detected a longer match
OP_COPY_N4_N2 3888640 512
OP_COPY_N4_N2 3888640 512
OP_END
```


That 21kB LITERAL is the difference in size we saw in the test results.
footer:
Signed-off-by: Leandro Motta Barros <leandro@balena.io>
signed-off-by: Leandro Motta Barros <leandro@balena.io>
Change-type: patch
change-type: patch
author: Leandro Motta Barros
nested: []
- subject: Minor code and comments tweaks
hash: 7dd51428c918980163fbe34511152dc72e7a3372
body: >
Using `defer` for the sake of being more idiomatic (and
maybe slightly

more reliable); plus, using the proper doc comment standards.
footer:
Signed-off-by: Leandro Motta Barros <leandro@balena.io>
signed-off-by: Leandro Motta Barros <leandro@balena.io>
Change-type: patch
change-type: patch
author: Leandro Motta Barros
nested: []
version: balena-engine-20.10.37
title: ""
date: 2023-06-26T13:44:22.217Z
version: meta-balena-2.115.15
title: ""
date: 2023-06-28T02:21:32.534Z
- commits:
- subject: Update tests/leviathan digest to a19d6ef
hash: 2283326d55c288889a02f04c471fe058576fd9b4
body: Update tests/leviathan
footer:
Change-type: patch
change-type: patch
author: Self-hosted Renovate Bot
nested:
- commits:
- subject: Update balena-os/leviathan-worker to v2.9.8
hash: 2a3757973579a8beeaa1aca0f226a58857d28e32
body: |
Update balena-os/leviathan-worker from 2.9.7 to 2.9.8
footer:
Change-type: patch
change-type: patch
author: Self-hosted Renovate Bot
nested: []
version: leviathan-2.27.9
title: ""
date: 2023-06-27T15:57:35.158Z
- commits:
- subject: Update core/contracts digest to 6c4386a
hash: 18ddcf64b3db0ac97051e86e9efaf63f5a183d2a
body: |
Update core/contracts
footer:
Change-type: patch
change-type: patch
author: Self-hosted Renovate Bot
nested: []
version: leviathan-2.27.8
title: ""
date: 2023-06-27T12:08:02.856Z
- commits:
- subject: "patch: Update QEMU getting started guide"
hash: 04333e2ffabf3044ad288c6588470373d6a97b6f
body: ""
footer:
Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipulgupta2048@gmail.com>
signed-off-by: Vipul Gupta (@vipulgupta2048) <vipulgupta2048@gmail.com>
author: Vipul Gupta (@vipulgupta2048)
nested: []
version: leviathan-2.27.7
title: ""
date: 2023-06-22T12:30:58.563Z
version: meta-balena-2.115.14
title: ""
date: 2023-06-27T20:32:39.974Z
version: 2.115.15
title: ""
date: 2023-06-28T03:22:08.394Z
- commits:
- subject: Update contracts to 6c4386a7b918796f26b7e06e8ee5585403330e4f
hash: ecfc2d8e7340732dea447934d273442042d404c3
Expand Down
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,59 @@
# Change Log
-----------

# v2.115.15
## (2023-06-28)


<details>
<summary> Update layers/meta-balena to c2e6ca9d57fd7214fe7c078591741a9c0fa6de73 [Self-hosted Renovate Bot] </summary>

> ## meta-balena-2.115.15
> ### (2023-06-28)
>
>
> <details>
> <summary> Update balena-engine to v20.10.37 [Self-hosted Renovate Bot] </summary>
>
>> ### balena-engine-20.10.37
>> #### (2023-06-26)
>>
>> * Bugfix: concatReadSeekCloser.Read() with buffers of any size [Leandro Motta Barros]
>> * Minor code and comments tweaks [Leandro Motta Barros]
>>
>
> </details>
>
>
> ## meta-balena-2.115.14
> ### (2023-06-27)
>
>
> <details>
> <summary> Update tests/leviathan digest to a19d6ef [Self-hosted Renovate Bot] </summary>
>
>> ### leviathan-2.27.9
>> #### (2023-06-27)
>>
>> * Update balena-os/leviathan-worker to v2.9.8 [Self-hosted Renovate Bot]
>>
>> ### leviathan-2.27.8
>> #### (2023-06-27)
>>
>> * Update core/contracts digest to 6c4386a [Self-hosted Renovate Bot]
>>
>> ### leviathan-2.27.7
>> #### (2023-06-22)
>>
>> * patch: Update QEMU getting started guide [Vipul Gupta (@vipulgupta2048)]
>>
>
> </details>
>
>
</details>

# v2.115.13+rev1
## (2023-06-27)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.115.13+rev1
2.115.15

0 comments on commit 941fef9

Please sign in to comment.