Code Monkey home page Code Monkey logo

Comments (2)

patriknw avatar patriknw commented on August 17, 2024

This seems to happen under rather normal conditions. See 16 here:

postgres=# select persistence_id, sequence_number, db_timestamp, write_timestamp from event_journal where persistence_id = 'TestEntity-1|p71' order by persistence_id, db_timestamp, sequence_number;

  persistence_id  | sequence_number |         db_timestamp          | write_timestamp
------------------+-----------------+-------------------------------+-----------------
 TestEntity-1|p71 |               1 | 2021-10-21 11:13:56.134083+00 |   1634814836096
 TestEntity-1|p71 |               2 | 2021-10-21 11:13:56.836606+00 |   1634814836553
 TestEntity-1|p71 |               3 | 2021-10-21 11:13:57.293981+00 |   1634814837199
 TestEntity-1|p71 |               4 | 2021-10-21 11:13:58.609032+00 |   1634814838602
 TestEntity-1|p71 |               5 | 2021-10-21 11:14:02.078275+00 |   1634814841899
 TestEntity-1|p71 |               6 | 2021-10-21 11:14:08.056475+00 |   1634814848040
 TestEntity-1|p71 |               7 | 2021-10-21 11:14:08.574025+00 |   1634814848557
 TestEntity-1|p71 |               8 | 2021-10-21 11:14:14.25899+00  |   1634814853569
 TestEntity-1|p71 |               9 | 2021-10-21 11:14:14.310217+00 |   1634814854286
 TestEntity-1|p71 |              10 | 2021-10-21 11:14:19.647697+00 |   1634814859571
 TestEntity-1|p71 |              11 | 2021-10-21 11:14:27.876247+00 |   1634814866869
 TestEntity-1|p71 |              12 | 2021-10-21 11:14:27.900744+00 |   1634814867860
 TestEntity-1|p71 |              16 | 2021-10-21 11:14:28.009415+00 |   1634814868008
 TestEntity-1|p71 |              13 | 2021-10-21 11:14:28.014187+00 |   1634814867931
 TestEntity-1|p71 |              14 | 2021-10-21 11:14:28.022303+00 |   1634814867985
 TestEntity-1|p71 |              15 | 2021-10-21 11:14:28.040212+00 |   1634814868004

from akka-persistence-r2dbc.

patriknw avatar patriknw commented on August 17, 2024

One solution suggestion is to look at timestamp from previous sequence_number:

insert into event_journal_test (persistence_id, sequence_number, db_timestamp)
  values ('pid1', 8, greatest(transaction_timestamp(), 
    (select db_timestamp + '1 microsecond'::interval from event_journal_test where persistence_id = 'pid1' and sequence_number = 7)));

from akka-persistence-r2dbc.

Related Issues (20)

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.