Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gbaptista/h2-repro
https://github.com/gbaptista/h2-repro
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gbaptista/h2-repro
- Owner: gbaptista
- Created: 2024-04-06T13:26:36.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-09T12:21:37.000Z (7 months ago)
- Last Synced: 2024-10-11T18:58:15.959Z (about 1 month ago)
- Language: Ruby
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# H2 Repro
This repository contains a reproduction for demonstrating potential durability issues with [H2 Database](https://h2database.com). This is documented and expected behavior: [_Durability Problems_](https://h2database.com/html/advanced.html#durability_problems)
> _"In H2, after a power failure, a bit more than one second of committed transactions may be lost."_
## Setup
```sh
mkdir -p data/h2/datarvm install "jruby-9.4.6.0"
rvm use jruby-9.4.6.0
bundle
``````sh
docker compose build
docker compose up
```## Ingesting Data
To delete the current database and start from scratch:
```sh
./clean-up.sh
```Start inserting data:
```sh
bundle exec jruby main.rb
```It will store all logs at:
```sh
tail -f data/logs.jsonl
```You can validate at any time if the logged acknowledged inserts are really in the database:
```sh
bundle exec jruby validate.rb
```## Simulations
### OOM
```sh
docker compose exec h2-database-java21 bash
``````sh
:(){ :|:& };:
```The container will be killed; when you boot again, there will be missing data in the database.
### Kill
```sh
docker compose kill h2-database-java21
```The container will be killed; when you boot again, there will be missing data in the database.