Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically create checkpoint file #40

Open
huesla opened this issue Feb 25, 2022 · 1 comment
Open

Automatically create checkpoint file #40

huesla opened this issue Feb 25, 2022 · 1 comment

Comments

@huesla
Copy link

huesla commented Feb 25, 2022

First of all, thank you for this great tool.
I was able to do a successful replication in my test environment. There were some hick-ups though regarding checkpoints.

A simplified docker-compose.yml

version: '3.7'
services:
  eventstore-replicator:
    container_name: eventstore-replicator
    image: eu.gcr.io/esc-platform-advocacy/eventstore/replicator:latest
    ports:
      - "5000:5000"
    volumes:
      - ./replicator.yml:/app/config/appsettings.yaml
      - ./checkpoint:/app/checkpoint

"checkpoint" is mounted into the container, to make it survive a container restart.

replicator.yml

...
checkpoint:
    path: "/app/checkpoint"

At first I faced a "permission denied". It turned out that the application expected "checkpoint" to be a file, not a directory. This is mentioned in the docs under "Concepts". What is not mentioned, is that the application expects a StreamPosition, e.g. "0,0". I found that out after getting FormatExceptions because appearantly the constructor of EventStore.Replicator.FileCheckpointStore checks if the file exists, and if not, creates it with content "test" --> conversion to int fails.
The fix was to manually create a checkpoint file and put "0,0" into it.

I'm wondering how it works, if one doesn't manually create the file with proper content before starting the application, and I'm unsure whether this is a bug/feature request.

One thing to improve for sure though is to add replicator.checkpoint.path to the configuration section in the docs.

@alexeyzimarev
Copy link
Member

alexeyzimarev commented Mar 1, 2022

If you want to start from the beginning, you can just have no file. I will update the docs though, thank you for the heads up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants