unable to apply large batches of changes with HTTP sync NpgsqlTransaction error #1341
Unanswered
federicoMoroni-git
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hello @Mimetis ,
following this discussion "sync over HTTP does not trigger function on postgres #1335" LINK for which I`ve created a testing repo REPO
I am facing another issue: when working with small batches of changes in the table the HTTP sync work just fine.
but when my client database grows too much (i.e 40k new records. the sync fails.)
the exceptions message is not very useful in this case
`
[08:41:16] 0,5% - Sending Batch Changes. Batches: (90/97). Rows: (37170/40000). Waiting Server Response...
␦ Stage: ChangesSelecting, Type: Normal
[08:41:16] 0,5% - Sending Batch Changes. Batches: (91/97). Rows: (37583/40000). Waiting Server Response...
␦ Stage: ChangesSelecting, Type: Normal
[08:41:16] 0,5% - Sending Batch Changes. Batches: (92/97). Rows: (37996/40000). Waiting Server Response...
␦ Stage: ChangesSelecting, Type: Normal
[08:41:16] 0,5% - Sending Batch Changes. Batches: (93/97). Rows: (38409/40000). Waiting Server Response...
␦ Stage: ChangesSelecting, Type: Normal
[08:41:16] 0,5% - Sending Batch Changes. Batches: (94/97). Rows: (38822/40000). Waiting Server Response...
␦ Stage: ChangesSelecting, Type: Normal
[08:41:16] 0,5% - Sending Batch Changes. Batches: (95/97). Rows: (39235/40000). Waiting Server Response...
␦ Stage: ChangesSelecting, Type: Normal
[08:41:17] 0,5% - Sending Batch Changes. Batches: (96/97). Rows: (39648/40000). Waiting Server Response...
␦ Stage: ChangesSelecting, Type: Normal
[08:41:17] 0,5% - Sending Batch Changes. Batches: (97/97). Rows: (40000/40000). Waiting Server Response...
␦ Stage: ChangesSelecting, Type: Normal
[08:44:00] 1,0% - Session Ends. Id:97ef12b7-1837-44c5-9037-b5fcd505e86b. Scope name:trackplot_cog_sync_0_0_0.
␦ Stage: EndSession, Type: Normal
[08:44:00] 1,0% - Received a message from https://myAPI.net/api/sync, Step:SendChangesInProgress, StatusCode: 200, ReasonPhrase: OK, Version: 1.1
␦ Stage: EndSession, Type: Normal
[08:44:00] 1,0% - Session Ends. Id:97ef12b7-1837-44c5-9037-b5fcd505e86b. Scope name:trackplot_cog_sync_0_0_0.
␦ Stage: EndSession, Type: Normal
Sync failed with error: [InternalApplyThenGetChangesAsync]..[InternalApplyThenGetChangesAsync]..[GetConnectionAsync]..NpgsqlTransaction
└ ─ NpgsqlTransaction
└ ─ NpgsqlTransaction
Stack Trace: at Dotmim.Sync.SyncAgent.SynchronizeAsync(String scopeName, SyncSetup setup, SyncType syncType, SyncParameters parameters, CancellationToken cancellationToken, IProgress
1 progress) at Dotmim.Sync.SyncAgent.SynchronizeAsync(String scopeName, SyncSetup setup, SyncType syncType, SyncParameters parameters, CancellationToken cancellationToken, IProgress
1 progress)at DotmimIssueReproduction.Program.SynchronizeAsync(String apiUrl, String sqlitePath) in C:\Users\me\Desktop\Projects\dotmimIssuePostgres\client\dotmimIssue\Program.cs:line 138
at DotmimIssueReproduction.Program.Main(String[] args) in C:\Users\me\Desktop\Projects\dotmimIssuePostgres\client\dotmimIssue\Program.cs:line 64
`
In the mentioned REPOSITORY I`ve put a .py file (@generate_records.py) to quickly create 40k entries in the sqlite table. when launching the sync again it fails with this exception.
Any idea of what could cause this? i am afraid it could be a timeout problem. I tried to set DbCommandTimeout = 60000000 in the sync options but with no joy
Beta Was this translation helpful? Give feedback.
All reactions