You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to restart sync from whatever frame number the server returns to us, even if we have a higher cached frame number. This can happen, for example, if someone deletes and re-creates a remote database, resetting it to generation 1 and frame 0.
The text was updated successfully, but these errors were encountered:
This commit adds a new error returned from `SyncContext` that indicates
that the server returned a lower frame_no than what the local cached
max server frame no expected (durable_frame_num). When the high level
`Database::push` fn gets this error it will restart the sync which will
pick up the new server side frame hint that we got and start sync from
that frame_no.
Test output:
```
2024-11-27T15:45:27.284544Z DEBUG libsql::sync: no metadata info file found
2024-11-27T15:45:27.284603Z DEBUG push_one_frame{generation=1 frame_no=0}: libsql::sync: pushing frame
2024-11-27T15:45:27.285044Z DEBUG push_one_frame{generation=1 frame_no=0}: libsql::sync: frame successfully pushed durable_frame_num=0
2024-11-27T15:45:27.315258Z DEBUG libsql::sync: read sync metadata for db_path="/var/folders/xf/644ms45s1dj06pdbkn9ybs_80000gn/T/.tmpwvzlR0/test.db", metadata=MetadataJson { hash: 1306961641, version: 0, durable_frame_num: 3, generation: 1 }
2024-11-27T15:45:27.315287Z DEBUG push_one_frame{generation=1 frame_no=4}: libsql::sync: pushing frame
2024-11-27T15:45:27.315517Z DEBUG push_one_frame{generation=1 frame_no=4}: libsql::sync: server returned durable_frame_num lower than what we sent: sent=4, got=1
2024-11-27T15:45:27.315543Z DEBUG push_one_frame{generation=1 frame_no=2}: libsql::sync: pushing frame
2024-11-27T15:45:27.315649Z DEBUG push_one_frame{generation=1 frame_no=2}: libsql::sync: frame successfully pushed durable_frame_num=2
```
Closes#1838
We need to restart sync from whatever frame number the server returns to us, even if we have a higher cached frame number. This can happen, for example, if someone deletes and re-creates a remote database, resetting it to generation 1 and frame 0.
The text was updated successfully, but these errors were encountered: