-
Notifications
You must be signed in to change notification settings - Fork 1k
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
TimestampProvider not working or not being used #5076
Comments
This looks like a bug alright! We'll see if we can get this patched before we do v1.4.21 later this week. |
Should actually be a pretty trivial fix - just need to have the timestamp provider call there instead of |
Yes indeed. Thats what I thought as well. But I'm not really into this code, so I thought probably I missed something and I did something wrong... 😊 |
@MartijnSchoemaker feel free to send us a PR if you want! 👍 |
Since the concept of |
@ismaelhamed I figured as much - no big deal. This is the first time in ~7 years I've ever heard of someone actually customizing the |
We get a list of mutations of an object from another party every 5 weeks. |
@MartijnSchoemaker makes sense! |
Version Information
Version of Akka.NET?
1.4.19
Which Akka.NET Modules?
Akka.Persistence.Sql.Common.Journal
Describe the bug
I implemented a custom
ITimestampProvider
for SQL Persistence Journal.I put a breakpoint in
GenerateTimestamp()
and let this method return 0.But every time I persist an entity I keep seeing DateTime.UtcNow.Ticks used as TimeStamp.
To Reproduce
ITimestampProvider
. Let method return 0.persistence : { journal : { plugin : akka.persistence.journal.sql-server sql-server : { timestamp-provider : "xx.xx.xx, xx.xx" } }
Expected behavior
Use long returned by custom
ITimestampProvider
.Actual behavior
DateTime.UtcNow.Ticks is used as TimeStamp.
Additional context
I tried to debug this and found out that in
SqlServerJournal
line 62 is returning an instance of my ownTimetampProvider
. So that seems to work!https://github.com/akkadotnet/Akka.Persistence.SqlServer/blob/6f9eae1f0d17ab76adf60809e2a631d8acfa2e82/src/Akka.Persistence.SqlServer/Journal/SqlServerJournal.cs#L62
But another thing I saw in the source is that in
AbstractQueryExecutor
the TimestampProvider is passed as parameter, but only the property is set. It seems that the property is never used.akka.net/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs
Line 319 in 55c1175
In InsertBatchAsync as timestamp is used 'DateTime.UtcNow.Ticks'. I should expect the TimestampProvider being used here?
akka.net/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs
Line 687 in 55c1175
Screenshots
The text was updated successfully, but these errors were encountered: