976c1f3929
Crashes observed on a FreeBSD 11.2 system 2018-09-27T05:08:39+02:00 [INFO][csnas]: start replication invocation="62" 2018-09-27T05:08:39+02:00 [INFO][csnas][repl]: start planning invocation="62" 2018-09-27T05:08:58+02:00 [INFO][csnas][repl]: start working invocation="62" 2018-09-27T05:09:57+02:00 [INFO][csnas]: start pruning sender invocation="62" 2018-09-27T05:10:11+02:00 [INFO][csnas]: start pruning receiver invocation="62" 2018-09-27T05:10:32+02:00 [INFO][csnas]: wait for wakeups 2018-09-27T06:08:39+02:00 [INFO][csnas]: start replication invocation="63" 2018-09-27T06:08:39+02:00 [INFO][csnas][repl]: start planning invocation="63" 2018-09-27T06:08:44+02:00 [INFO][csnas][repl]: start working invocation="63" 2018-09-27T06:08:49+02:00 [ERRO][csnas][repl]: receive request failed (might also be error on sender) invocation="63" filesystem="<REDACTED>" err="concurrent use of RPC connection" step="<REDACTED>(@zrepl_20180927_030838_000 => @zrepl_20180927_040835_000)" errType="*errors.errorString" panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x7d484b] goroutine 3938545 [running]: os.(*ProcessState).os.sys(...) /usr/lib/golang/src/os/exec_posix.go:78 os.(*ProcessState).Sys(...) /usr/lib/golang/src/os/exec.go:157 github.com/zrepl/zrepl/util.(*IOCommand).doWait(0xc4201b2d80, 0xc420070060, 0xc420070060) /go/github.com/zrepl/zrepl/util/iocommand.go:91 +0x4b github.com/zrepl/zrepl/util.(*IOCommand).Read(0xc4201b2d80, 0xc420790000, 0x8000, 0x8000, 0x800c76d90, 0x0, 0xc420067c10) /go/github.com/zrepl/zrepl/util/iocommand.go:82 +0xe4 github.com/zrepl/zrepl/util.(*ByteCounterReader).Read(0xc4202dc580, 0xc420790000, 0x8000, 0x8000, 0x8c6900, 0x7cb201, 0xc420790000) /go/github.com/zrepl/zrepl/util/io.go:118 +0x51 github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc.(*chunkBuffer).readChunk(0xc42057e3c0, 0x800d1bbf0, 0xc4202dc580, 0xc420790000, 0x8000, 0x8000) /go/github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc/stream.go:58 +0x5e github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc.writeStream(0xa04620, 0xc4204a9c20, 0x9fe340, 0xc4200d6380, 0x800d1bbf0, 0xc4202dc580, 0x8000, 0xc42000e000, 0x900420) /go/github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc/stream.go:101 +0x1ce github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc.(*Conn).send(0xc4200d6380, 0xa04620, 0xc4204a9c20, 0xc42057e2c0, 0xc42013d570, 0x800d1bbf0, 0xc4202dc580, 0x0, 0x0) /go/github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc/main.go:374 +0x557 github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc.(*Client).RequestReply.func1(0x999741, 0x7, 0xc4200d6380, 0xa04620, 0xc4204a9c20, 0xc42013d570, 0xa00aa0, 0xc4202dc580, 0xc420516480) /go/github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc/client.go:169 +0x148 created by github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc.(*Client).RequestReply /go/github.com/zrepl/zrepl/vendor/github.com/problame/go-streamrpc/client.go:167 +0x227 |
||
---|---|---|
client | ||
config | ||
daemon | ||
docs | ||
endpoint | ||
logger | ||
pruning | ||
replication | ||
tlsconf | ||
util | ||
version | ||
zfs | ||
.gitignore | ||
.gitmodules | ||
build.Dockerfile | ||
Gopkg.lock | ||
Gopkg.toml | ||
lazy.sh | ||
LICENSE | ||
main.go | ||
Makefile | ||
README.md |
zrepl
zrepl is a ZFS filesystem backup & replication solution written in Go.
User Documentation
User Documentation can be found at zrepl.github.io.
Bug Reports
- If the issue is reproducible, enable debug logging, reproduce and capture the log.
- Open an issue on GitHub, with logs pasted as GitHub gists / inline.
Feature Requests
- Does you feature request require default values / some kind of configuration? If so, think of an expressive configuration example.
- Think of at least one use case that generalizes from your concrete application.
- Open an issue on GitHub with example conf & use case attached.
The above does not apply if you already implemented everything. Check out the Coding Workflow section below for details.
Package Maintainer Information
- Follow the steps in
docs/installation.rst -> Compiling from Source
and read the Makefile / shell scripts used in this process. - Make sure your distro is compatible with the paths in
docs/installation.rst
. - Ship a default config that adheres to your distro's
hier
and logging system. - Ship a service manager file and please try to upstream it to this repository.
- Use
make release ZREPL_VERSION='mydistro-1.2.3_1'
- Your distro's name and any versioning supplemental to zrepl's (e.g. package revision) should be in this string
- Make sure you are informed about new zrepl versions, e.g. by subscribing to GitHub's release RSS feed.
Developer Documentation
First, use ./lazy.sh devsetup
to install build dependencies and read docs/installation.rst -> Compiling from Source
.
Overall Architecture
The application architecture is documented as part of the user docs in the Implementation section (docs/content/impl
).
Make sure to develop an understanding how zrepl is typically used by studying the user docs first.
Project Structure
├── cmd
│ ├── endpoint # implementations of endpoints for package replication
│ ├── sampleconf # example configuration
├── docs # sphinx-based documentation
│ ├── **/*.rst # documentation in reStructuredText
│ ├── sphinxconf
│ │ └── conf.py # sphinx config (see commit 445a280 why its not in docs/)
│ ├── requirements.txt # pip3 requirements to build documentation
│ ├── publish.sh # shell script for automated rendering & deploy to zrepl.github.io repo
│ ├── public_git # checkout of zrepl.github.io managed by above shell script
├── logger # logger package used by zrepl
├── replication # replication functionality
├── rpc # rpc protocol implementation
├── util
└── zfs # ZFS wrappers, filesystemm diffing
Coding Workflow
- Open an issue when starting to hack on a new feature
- Commits should reference the issue they are related to
- Docs improvements not documenting new features do not require an issue.
Breaking Changes
Backward-incompatible changes must be documented in the git commit message and are listed in docs/changelog.rst
.
- Config-breaking changes must contain a line
BREAK CONFIG
in the commit message - Other breaking changes must contain a line
BREAK
in the commit message
Glossary & Naming Inconsistencies
In ZFS, dataset refers to the objects filesystem, ZVOL and snapshot.
However, we need a word for filesystem & ZVOL but not a snapshot, bookmark, etc.
Toward the user, the following terminology is used:
- filesystem: a ZFS filesystem or a ZVOL
- filesystem version: a ZFS snapshot or a bookmark
Sadly, the zrepl implementation is inconsistent in its use of these words: variables and types are often named dataset when they in fact refer to a filesystem.
There will not be a big refactoring (an attempt was made, but it's destroying too much history without much gain).
However, new contributions & patches should fix naming without further notice in the commit message.