Conversation
Signed-off-by: Sander Pick <sanderpick@gmail.com>
a0185a6 to
db9fbf6
Compare
| } | ||
|
|
||
| func (n *net) pullThread(ctx context.Context, id thread.ID) error { | ||
| log.Debugf("pulling thread %s...", id) |
There was a problem hiding this comment.
This creates too much output, to the point where you can't easily make sense of the logs.
|
|
||
| // RefreshCollection updates the transaction's collection reference from the master db map, | ||
| // which may have received updates while the transaction is open. | ||
| func (t *Txn) RefreshCollection() error { |
There was a problem hiding this comment.
This is needed to pick up collection changes during a transaction.
There was a problem hiding this comment.
This seems odd given we're using a transaction here :P But I guess this actually makes sense, given our transactions provide atomicity but not isolation guarantees!
There was a problem hiding this comment.
Yeah, it's kinda weird :/ Though, the transaction changes themselves and the underlying state are still "locked" during the transaction, as you stated differently above. Really I just needed the ability to update the collection after catching a schema mismatch error during the txn.
|
Oh, note that the new errors are only used during a transaction... normal non-txn calls return the error as before. |
carsonfarmer
left a comment
There was a problem hiding this comment.
This is great @sanderpick, exactly what we need for remote offline-frist updates tbh.
|
Thanks for the late night look! |
|
mark |
Right now, when you call methods on a transaction like
Save,Delete, etc., an error will end the txn, which is cumbersome in cases where you want to handle that error and retry (w/o recreating the whole transaction).Easiest solution: Add an error to all the reply objects (CreateReply, etc.)