tigerbeetle-node
Advanced tools
Changelog
TigerBeetle 0.16.14
Released: 2024-11-25
Call DetachCurrentThread
when the Java client is closed. The underlying Zig TigerBeetle client
runs in a separate thread internally, and a handler to this thread was being leaked.
This is not noticeable in normal operation, but could impact long running processes that create and close clients frequently.
Document that it's not possible to currently look up or query more than a full batch of accounts atomically without using the history flag and querying balances.
Add the ability to check timestamp order - and verify they are monotonically increasing - for accounts and transfers inside Vortex.
Recently the VOPR has gotten too good, and it's very tempting to switch to an empirical mode of coding: write some code and let the VOPR figure out whether it is correct or not.
This is suboptimal - silence of the VOPR doesn't guarantee total absence of bugs and safety comes in layers and cross checks. Just formal or informal reasoning is not enough, we need both.
Document this in TigerStyle.
Previously, the Zig part of languages clients logged directly to stderr using Zig's std.log
, but
since directly outputting to stderr is considered rude for a library, logging was disabled.
This PR adds in scaffolding for sending these logs to the client language to be handled there, tying in with native log libraries (eg, Log4j). No languages use it yet, however.
Additionally, log warn
and err
directly to stderr, if there's no handler.
Changelog
TigerBeetle 0.16.13
Released: 2024-11-18
Fix a broken assert when a recently-state-synced replica that has not completed journal repair
receives an old commit
message.
Retry EAGAIN
on (disk) reads. This is essential for running TigerBeetle on XFS, since XFS
returns EAGAIN
unexpectedly.
Fix a message bus crash when a client reconnects to a replica without the replica receiving a disconnect for the first connection.
Save 256KiB of RAM by not having a prefetch cache for historical balances. (Historical balances are never prefetched, so this cache was unused.)
Update hardware requirements in the documentation to include the recommended network bandwidth, advice for very large data files, and farther emphasis on the importance of ECC RAM.
Don't panic the client when the client's session is
evicted.
Instead, report an error any time a new batch is submitted to the evicted client.
(How the error is reported depends on the client language – e.g. Java throws an exception, whereas
Node.js rejects the Promise
).
Note that if running clients are evicted, that typically indicates that there are too many clients running – check out the suggested system architecture.
Add REPL interactivity. Also change the REPL from dynamic to static allocation. Thanks @wpaulino!
Expose the VSR timestamp to the client. (This is an experimental feature which will be removed soon – don't use this!)
Changelog
TigerBeetle 0.16.12
Released: 2024-11-11
Fix an attempt to access uninitialized fields of tb_packet_t
when tb_client_deinit
aborts
pending requests. Also add Java unit tests to reproduce the problem and validate the fix.
Fix a liveness issue where the cluster gets stuck despite sufficient durability, caused by buggy
logic for cycling through faulty blocks during repair. Now, we divide the request buffer between
the read_global_queue
and faulty_blocks
, ensuring that we always request blocks from both.
Update DevHub styling.
Vortex can now not only crash replicas (by killing and restarting the process) but also stop and resume them.
Fix the Dotnet walkthrough example that misused length
instead of the final index when slicing
an array. Thanks @tenatus for reporting it!
Fix a CI failure caused by concurrent processes trying to create the fs_supports_direct_io
probe file in the same path.
Replace curl shell invocation with Zig's http client. 😎
Properly handle "host unreachable" (EHOSTUNREACH
) on Linux, instead of returning unexpected
error.
#2443, #2451, #2459, #2460, #2465
Various code refactorings to improve naming conventions, readability, and organization.
Released: 2024-11-04
Add "Vortex" – a full-system integration test. Notably, unlike the VOPR this test suite covers the language clients.
Cancel in-flight async (Linux) IO before freeing memory. This was not an issue on the replica side, as replicas only stop when their process stops. However, clients may be closed without the process also ending. If IO is still in flight when this occurs, we must ensure that all IO is cancelled before the client's buffers are freed, to guard against a use-after-free.
This PR also fixes an unrelated assertion failure that triggered when closing a client that had already closed its socket.
On startup and after checkpoint, assert that number of blocks acquired by the free set is consistent with the number of blocks we see acquired via the manifest and checkpoint trailers.
Reject connections from unknown replicas.
Fix multiversion builds on MacOS.
On an unrecognized error code from the OS, print that error before we panic.
(This was already the policy in Debug
builds, but now it includes ReleaseSafe
as well.)
Fix a panic involving an in-flight write to an old reply after state sync.
Expose reply timestamp from vsr.Client
.
(Note that this is not yet surfaced by language clients).
Changelog
TigerBeetle 0.16.11
Released: 2024-10-28
Make Grid.reserve()
abort rather than returning null.
When Grid.reserve()
aborts, that indicates that the data file size limit would be exceeded by
the reservation. We were already panicking in this case by unwrapping the result, but now it has
a useful error message.
Improve availability and performance by sending start_view
message earlier in the new-primary
recovery – as soon as the journal headers are repaired.
Refactor compaction to clarify the scheduling logic, schedule more aggressively, and make it easier to run multiple compactions concurrently. This also improved the benchmark performance.
Support multiversion (non-automatic) upgrades when the replica is started with --development
or --experimental
.
Allow a release's Git tag and config.process.release
to differ. This simplifies the release
process for hotfixes, when the Git tag is bumped but the config.process.release
is unchanged.
Changelog
TigerBeetle 0.16.10
Released: 2024-10-21
Improve performance & availability during view change by ensuring a replica only repairs the portion of the WAL that is required to become primary, instead of repairing it in its entirety.
Add a unit test for Zig's stdlib sort.
Stable sort is critical for compaction correctness. Zig stdlib does have a sort fuzz test, but it doesn't cover the presorted subarray case, and doesn't check arrays much larger than the sort algorithm's on-stack cache.
Fix a bug in the MessageBus wherein connections weren't being terminated during client teardown.
Fix a bug in the benchmark wherein the usage of --account-count-hot
was broken when used in
conjunction with the uniform
distribution.
Revamp the core_missing_prepares
liveness-mode check to correctly check for the prepares that a
replica should repair (after #2414).
Changelog
TigerBeetle 0.16.9
Released: 2024-10-15
TigerBeetle clients internally batch operations for improved performance. Fix a bug where an unclosed link chain could be batched before another linked chain, causing them to be treated as one long linked chain. Additionally, prevent non-batchable requests from sharing packets entirely.
AMOUNT_MAX
is used as a sentinel value for things like balancing transfers to specify moving
as much as possible. Correct and fix its value in the Java client. Thanks @tKe!
Improve the benchmark by adding Zipfian distributed random numbers, to better simulate realistic conditions and as a precursor to approximating YCSB.
Previously, TigerBeetle's clients disallowed empty batches locally, before the request was even sent to the cluster. However, this is actually a valid protocol message - even if it's not used by the current state machine - so allow empty batches to be sent from clients.
Revamp client documentation so that each snippet is self-contained, and standardize it across all languages.
Give the DevHub a fresh coat of paint, and fix passing seeds being blue in dark mode.
#2408, #2400, #2391, #2399, #2402, #2385
Improve VOPR logging and fix a few failing seeds.
Changelog
TigerBeetle 0.16.8
Released: 2024-10-07
Significantly reduced P100 latency by incrementally spreading the mutable table's sort during compaction. This leverages the optimization of sort algorithms for processing sequences of already sorted sub-arrays.
Improve the workload generator to support concurrent tests with different ledgers.
Fix VOPR seeds. For more awesome details about the backstory and solutions to these issues, please refer to the PR.
Update the REPL to support representing the maximum integer value as -0
,
serving as the AMOUNT_MAX
sentinel.
Additionally, other negative values such as -1
can be used to represent maxInt - 1
.
Also, include support for hexadecimal numbers for more convenient inputting of GUID/UUID
literals (e.g. 0xa1a2a3a4_b1b2_c1c2_d1d2_e1e2e3e4e5e6
).
Allow the timestamp
field to be set, enabling the REPL to be used for imported
events.
Use zig fetch
as a replacement for downloading files, removing dependence on external tools.
Port of Rust's dbg!
macro to Zig,
and the corresponding CI validation to prevent code using it from being merged into main
! 😎
Verify the release versions included in the multiversion binary pack at build time (not only
during runtime) and improve the tigerbeetle version --verbose
command's multiversion
output.
Fix a multiversioning issue where the binary size exceeded the read buffer, failing to parse the executable header.
Consistently use transient_error
instead of transient_failure
and cleanup the StateMachine
code.
Add missing links to the operations query_accounts
and query_transfers
in the documentation
and include the declaration for QueryFilter
and QueryFilterFlags
in the tb_client.h
header.
Clearer error message when the replica crashes due to a data file being too large, instructing the operator to increase the memory allocated for the manifest log.
Changelog
TigerBeetle 0.16.4
Released: 2024-09-30
This release introduces "transient errors": error codes for create_transfers
which depend on the
state of the database (e.g. exceeds_credits
). Going forward, a transfer that fails with a
transient error will not succeed if retried.
See the API tracking issue and the documentation for more details.
Reduce chance of recovering_head
status by recovering from torn writes in the WAL.
This improves the availability of the cluster, as recovering_head
replicas cannot participate in
consensus until after they repair.
Ensure idempotence for create_transfers
' "transient errors" with new result code
id_already_failed
. In particular, this guards against surprising behavior when the client is
running in a stateless API service.
Changelog
TigerBeetle 0.16.3
Released: 2024-09-23
Improve cluster availability by more aggressive recovery for crashes that happen while a replica is checkpointing.
Add a more efficient recipe for balance-conditional transfers. A balance-conditional transfer is a transfer that succeeds only if the source account has more than a threshold amount of funds in it.
Add a new recipe for enforcing debits_must_not_exceed_credits
on some subset of transfers (this
is a special case of a balance-conditional transfer, with the threshold value being equal to
transferred amount).
Add triaged
issue label to prevent newly opened issues from slipping through the cracks.
Add CI check for dead code.
Cleanup the source tree by removing top-level tools
directory.
Make sure that process-spawning API used for build-time "scripting" consistently reports errors when the subprocess fails or hangs.
Changelog
TigerBeetle 0.16.2
Released: 2024-09-16
Tighten up the VSR assertions so the transition to .recovering_head
can only be called from the
.recovering
status.
Make the primary abdicate if it is unable to process requests due to a broken clock.
Smoke integration test using the real multiversion binary.
Workload generator based on the Java client to be used in integration tests (i.e. Antithesis).
#2298, #2307, #2304, #2309, #2321
Remove Tracy
integration and dependencies.
Add JSON traces for events with multiple running instances, such as IO, lookups, and scans.
Add the ability to filter by user_data_{128,64,32}
and code
in get_account_transfers
and get_account_balances
.
Mute the log on stderr when building client libraries.
Reduce the log's severity of some entries logged as .err
to .warn
for less noise when
running with log_level = .err
.
Document and explain how time works in TigerBeetle ⏱️.
Refactor Forest.compact
and remove some dead code.
Rewrite commit_dispatch
, a chain of asynchronous stages calling each other, as a state machine
implementation that resembles linear control flow that is much easier to read.
Fix the Node.js example that was using an incorrect enum flag. Thanks for the heads up @jorispz!
Update outdated scripts in HACKING.md
.
Use git timestamps to build Docker images. This is a requirement for being deterministic in CI.
Devhub link to pending code reviews.