JasperFx / marten

.NET Transactional Document DB and Event Store on PostgreSQL
https://martendb.io
MIT License
2.79k stars 441 forks source link

fix: Tenanted bulk loading should consider tenant id as part of document identity #3297

Closed elexisvenator closed 2 months ago

elexisvenator commented 2 months ago

This fixes 2 issues:

Also has a small tweak to calling binay import to use the async method where appropriate.

elexisvenator commented 2 months ago

I also have an extension of this branch that changes the logic to use a single insert .. on conflict do update to make the merge quicker.

elexisvenator commented 2 months ago

Another bug that I haven't addressed as its more programmer error: There are no checks in place to ensure that a tenant is specified when the bulk imported document uses conjoined tenancy. Tenancy defaults to default but given how low level this op is it's probably worth requiring the use of default tenant to be explicit.