Giter Site home page Giter Site logo

Comments (5)

okumin avatar okumin commented on June 19, 2024

@ColinScott

Transactions are committed in this line, so it is expected that metadata and journal are written atomically.

Could you check some logs to confirm that transactions are written correctly?
I'm poor at postgresql but commit logs like MySQL's binlog maybe exist.

from akka-persistence-sql-async.

ColinScott avatar ColinScott commented on June 19, 2024

I'll see if I can build a minimal replication case and get some logs, although I'm not a PostgreSQL expert.

from akka-persistence-sql-async.

ColinScott avatar ColinScott commented on June 19, 2024

I've created a project that replicates the issue here: https://github.com/ColinScott/persist-test

I'm hosting the PostgreSQL instance in a docker image based on the official PostgreSQL image. You can run this with docker run --name some-postgres -e POSTGRES_PASSWORD=qazxsw21 -p 5432:5432 -d abstractcode/akka-postgres:9.4.6.

My first test run for this resulted in 7460 entries in the persistence_metadata table but none in the persistence_journal table. I didn't find any useful logs in the docker container running the database after this test (or indeed any PostgreSQL logs at all).

from akka-persistence-sql-async.

okumin avatar okumin commented on June 19, 2024

@ColinScott

Thanks for your minimal existence and it makes me realize the cause.

About inconsistency

PersistentActor replays existent a snapshot and journals first after creating.
PersistentActor of akka-persistent-sql-async inserts into metadata table on replaying those if its metadata has not yet created.

https://github.com/okumin/akka-persistence-sql-async/blob/master/core/src/main/scala/akka/persistence/snapshot/sqlasync/SQLAsyncSnapshotStore.scala#L15

Something like inconsistency happened due to that, but it is not inconsistency.
So you can run com.abstractcode.persisttest.TestMain with few Items(e.g. 1 to 100) on records created on high load.

Tests by TCK uses internal APIs directly, so I have observed transaction boundaries on such an abnormal environments.

About errors

Being related to underlying libraries, followings are guesses……

postgresql-async seems to collapse and becomes non-available once its buffer is overflowed.
That buffer is parameterized by configuring wait-queue-capacity parameter.

https://github.com/okumin/akka-persistence-sql-async/blob/master/core/src/test/resources/postgresql-application.conf#L11

However, buffers will be overflowed sometime if too many queries which postgresql cannot handle.
So you should take care of high loads.

akka-stream looks good for this problem……

from akka-persistence-sql-async.

ColinScott avatar ColinScott commented on June 19, 2024

Thanks for looking at this.

from akka-persistence-sql-async.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.