Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 31 19:32

    prolic on v1.10.3

    (compare)

  • Jan 31 19:32

    prolic on master

    update changelog (compare)

  • Jan 31 19:29
    prolic closed #176
  • Jan 31 19:28
    prolic commented #186
  • Jan 31 19:28
    prolic closed #186
  • Jan 31 19:28

    prolic on master

    fix restarting projection durin… respect lock in memory resetting projection and 12 more (compare)

  • Jan 31 16:26
    fritz-gerneth commented #189
  • Jan 31 16:21
    prolic commented #189
  • Jan 31 16:06
    sandrokeil commented #189
  • Jan 31 15:31
    grzegorzstachniukalm synchronize #186
  • Jan 31 15:23
    kamil-nawrotkiewicz edited #76
  • Jan 31 15:22
    kamil-nawrotkiewicz edited #76
  • Jan 31 15:22
    kamil-nawrotkiewicz opened #76
  • Jan 31 15:19
    grzegorzstachniukalm synchronize #186
  • Jan 31 15:09
    grzegorzstachniukalm synchronize #186
  • Jan 31 13:54
    coveralls commented #186
  • Jan 31 13:48
    mrook commented #189
  • Jan 31 13:41
    prolic commented #189
  • Jan 31 13:40
    prolic commented #189
  • Jan 31 13:31
    fritz-gerneth commented #189
MtK
@kochen
yes, that’s in general, but what I mean is running composer run test & composer cs-check & composer run analyze in parallel
(for example)
George
@gdsmith
if you build a test image you can have those as individual stages in your gitlab pipeline
MtK
@kochen
same stage, just different steps in it
image.png
George
@gdsmith
yes, like that :)
MtK
@kochen
@gdsmith how do you set these?
${TARGET:-development}
${TAG:-latest}
?
George
@gdsmith
in a .env file - docker compose picks those up by default
MtK
@kochen
@gdsmith how do you build (in your CI) the different stage images?
George
@gdsmith

you’d need something like the following:

image: docker:latest

…

stages:
- build
- test

build:
    stage: build
    services:
        - docker:dind
    script:
    - # login etc …
    - docker build --tag image-name:tag-test . --target test
    - docker build --tag image-name:tag-publish . --target publish
    - docker push image-name:tag-test
    - docker push image-name:tag-publish
test:
    stage: test
    services:
        - docker:dind
    script:
    - # login etc …
    - docker pull image-name:tag-test
    - docker run image-name:tag-test composer run test
analyse:
    stage: test
    services:
        - docker:dind
    script:
    - # login etc …
    - docker pull image-name:tag-test
    - docker run image-name:tag-test composer run analyse

Or maybe (depending on how your image store is configured) you can do the following:

test:
    stage: test
    image: image-name:tag-test
    script:
    - composer run test
analyse:
    stage: test
    image: image-name:tag-test
    script:
    - composer run analyse
MtK
@kochen
so every trigger of the CI you rebuild your images, right?
George
@gdsmith
that’s how we do it, yeah, it’s not perfect (it can be frustrating to rebuild when you’re changing deployment code for example) but it does allow us to easily deploy review/staging/production apps
Daniel Gimenes
@danizord
is it possible to insert 2 rows in a single transaction and for a very small period of time (like 1ms) only one of those rows become visible to projections?
one of my projections skipped another event, and I'm using the write lock strategy, so I guess the only possible reason here is that MySQL transactions are not 100% consistent :/
@fritz-gerneth did you have any skip with the write lock?
Fritz Gerneth
@fritz-gerneth
@danizord in a broader perspective I didn't see any skips. yet I am investigating a similar issue as you describe .. yet I assumed this to be an issue with the projection's code, not the projector missing events.. but your question made me re-think if this might be the same situation as you ask for.
on the original mysql question: that I don't know.. given the underlying issue was that write & read order were not the same on the initial issue across concurrent writers.. I see that might even be the case within a transaction (as I assume neither is an explicit decision but just how mysql works)..
does this only happen to you if you save multiple events within the same transaction?
(asking because this is happening for us - we're seeing this issue only on occassions when a writer adds multiple events in one transaction)
Daniel Strøm
@Danielss89
How would i go about loading the prior version of an aggregate root?
Fritz Gerneth
@fritz-gerneth
@Danielss89 have a look at https://github.com/prooph/event-sourcing/blob/master/src/Aggregate/AggregateRepository.php#L263 to see how to use the MetadataMatcher to load events based on their version number & apply them
Daniel Strøm
@Danielss89
Thanks!
Daniel Gimenes
@danizord
@fritz-gerneth not sure, but I'll investigate further to see if that's the case. I'm pretty sure it's a race condition because I have multiple projections and only one of them missed the event
also, in that moment we didn't have multiple concurrent writers, so the write lock could not prevent it
Fritz Gerneth
@fritz-gerneth
@danizord yes that pretty much looks like it. I won't have time to look into this any time soon though. maybe you could have a look at the original issue prooph/pdo-event-store#189 and adapt the scripts to do multiple inserts wrapped in a transaction
unfortunately unless there's some magic mysql flag I would not know of any direct solution to this, besides gap detection on the read side (which is not much of an issue for new streams as long as write locks are enabled.. as there would be no natural gaps occuring)
Daniel Gimenes
@danizord
@fritz-gerneth Your test scripts are already inserting 5 events in same transaction
running it with serializable transaction isolation for 24+ hours and no gaps so far :)
Fritz Gerneth
@fritz-gerneth
@danizord we might wanna change the setup slightly maybe.. so producer to produce events more in 'bursts' then frequent stream.. this should allow multiple consumers to be always at the newest event.. might simulate the situation better where projections are idle for a while and have to handle multiple events at the same time..
not really an expert on the details of mysql's isolation levels.. buy my understanding is that serializable transactions should not affect this.. repeatable-reads should be sufficient for this already
(e.g. so far we have no script to reproduce this error consitently.. even if this has not happend for 24hrs yet this might be coindicence, wrong scripts.. or actually a fix.. but we have no way of verification)
George
@gdsmith
How do people handle infrastructure type exceptions during message bus dispatch? For example; a mysql gone away exception, by default in prooph/service-bus these are caught and added to the event. I see I can add a plugin to inspect exceptions as part of the finalise portion. I’m thinking I could then rethrow a wrapped exception there, is that the recommended approach?
Alexander Miertsch
@codeliner
@gdsmith yes
Florian Krämer
@burzum
So when I have an event like InvoiceCreated and reconstitute my invoice from history, do I get it right, that the event will reconstruct the whole invoice object based on the nested data I've put in the event store?
Darryl Hein
@darrylhein
@burzum It will call the when... functions on your AR while loading the events & reconstituting.
Shaowei Pu
@m9rco
Good evening
I'm going to use prooph/improoph in my project
Alexander Miertsch
@codeliner
@m9rco :+1: is it your first CQRS / ES project?
Shaowei Pu
@m9rco
yep
I just read a few article CQRS/ES of the project
I try to use it, the future could be used in a production environment
I found that Chinese there was no use it, perhaps it is difficult to understand, hahah :)
Shaowei Pu
@m9rco
I have cloned some prooph project, hope it can help me understand CQRS/ES , thanks prooph team :)
Alexander Miertsch
@codeliner
@m9rco Check the Event Engine: https://event-engine.io/ especially the tutorial! It uses prooph under the hood, but is much easier to start with.
Shaowei Pu
@m9rco
thanks
Shaowei Pu
@m9rco
image.png
image.png
Darryl Hein
@darrylhein
I find myself doing a lot of 'var' => null !== $var ? $var->toArray() : null, (and similar other functions as toArray()). Is there a shorter way to do it? This is in messages (commands and events).
Alexander Miertsch
@codeliner
the FP approach would be to write a helper function like 'var' => nullOrToArray($var) ;)
Fritz Gerneth
@fritz-gerneth
bring your own message serializer that can handle arrays (or even objects if you like) :)