-
Notifications
You must be signed in to change notification settings - Fork 1.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
[wip] Close cursor if it's opened by different tx #12546
base: main
Are you sure you want to change the base?
Conversation
@awskii maybe we must
|
@AskAlexSharov from one side yes, it would be better to panic with info, but i had a small intention to reuse sharedDomains without closing and reopening (requires only to set up new aggtx) but this could end up badly. |
|
i found it useful while did commitment rebuilding. I am going to add panic as you said. |
eface := *(*[2]uintptr)(unsafe.Pointer(&tx)) | ||
if dt.valsC != nil { // run in assert mode only | ||
fmt.Printf("cmp e1=%x e2=%x s=%x d=%s\n", eface[0], eface[1], dt.vcParentPtr.Load(), dt.d.filenameBase) | ||
if !dt.vcParentPtr.CompareAndSwap(eface[1], eface[1]) { // cant swap when parent ptr is different |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need atomic here? sd
is not thread-safe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: tx
has method tx.ViewID()
this branch,
|
So we keep cursor interface opened inside
DomainRoTx
. If we then create new tx and try to read with it fromDomainRoTx
, value will be fetched via previously opened cursor which is not expected behaviour.I set stupid fix for that but i assume there could be better solutions.