If file doesn't grow in 10 sec, bbolt won't trigger the following
errors:
* lackOfDiskSpace
* mapError
* resizeFileError
* unmapError
We should switch to kill instead of waiting for panic. In order to
trigger these errors, we should increase value size to 512.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 49eb212fa8ab67709ea460df01982504cf7fa4a1)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
This also introduces mkfs options, in case we need to accomodate for
non-default parameters here in the future.
Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
(cherry picked from commit c27eedcf803fb5c6990d8846275c5136e06de1ae)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Update case with a combination of EXT4 filesystem's commit setting and
unexpected exit event. That EXT4 filesystem's commit is to sync all its data
and metadata every seconds. The kernel can help us sync even if that
process has been killed. With different commit setting, we can simulate
that case that kernel syncs half part of dirty pages before power
failure. And for unexpected exit event, we can kill that process
randomly or panic at failpoint instead of fixed code path.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 4c3a80b2c06cb5a39eeabe422f718a1b6cfc7be2)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
(cherry picked from commit 465077b9e2f3d0bfe593beda5a4b04ea1cd0915a)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
* tx.go: introduce failpoint before fdatasync
It can be used for power failure cases.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 445a07b6cb837d1196f9fceb7655900031ca093f)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
* tests/*: introduce go-dmflakey
This commit is to add go-binding for go-dmflakey. It's used to simulate
powerfailure with common filesystems.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit b05bec2fe3f4de1650daf868e507e686d86770a5)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
* tests/robustness: init with powerfailure case
Add `Robustness Test` pipeline for robustness test cases.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 300e72ab8a0d3b730dbafb3b5463f00615bbfc9b)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
---------
Signed-off-by: Wei Fu <fuweid89@gmail.com>
backport of #767 to fix the missing output on nightly benchmarks
Co-authored-by: Iván Valdés Castillo <iv@nvald.es>
Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
Changes (align with the main branch):
- remove rand.Seed(s)
- use rand.Read from "crypto/rand"
- add //nolint:all for (*reflect.SliceHeader)(slice) -> will fix in a
follow-up PR
Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
Co-authored-by: Iván Valdés Castillo <iv@nvald.es>
Changes:
- Bump toolchain version to 1.21.9 due to CVE-2023-45288
- run `go mod tidy`
Reference:
- PR etcd #17703
Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
It's follow-up of #637.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 62d80260de277168b2d59779bfb03c6ebfda08f4)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Application might change key value after seeking and before real put.
This unexpected behaviour could corrupt database. When users file issue,
maintainers doesn't know application behaviour. It could be caused by
data race. This patch is to prevent such case and save maintainers' time.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit a05ec68aaafcf77e22b9da83bd4069cad8cba39d)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 1b080787075bb3ec06a414c754da9ef66bda4071)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 324df9cd264b7f2c4504ea61758a4ea89373e4ce)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
As per `go build -gcflags -m ./... 2>&1`:
Old behaviour:
```
./bucket.go:148:31: leaking param: key
./bucket.go:192:42: leaking param: key
./bucket.go:271:22: leaking param: key
```
Now:
```
./bucket.go:148:31: key does not escape
./bucket.go:192:42: key does not escape
./bucket.go:271:22: key does not escape
```
Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
(cherry picked from commit 71a59caf31ca42c3deb8967ceee0a4804d220bf4)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
The first word in an allocated struct can be relied upon to be
64-bit aligned. Refer to https://pkg.go.dev/sync/atomic#pkg-note-BUG.
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Syscall numbers are not stable on OpenBSD, and hardcoding the msync
syscall number will break bbolt on future versions of OpenBSD. Use
the libc wrapper provided by golang.org/x/sys/unix instead.
Signed-off-by: Josh Rickmar <jrick@zettaport.com>