Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

awskii
Copy link
Member

@awskii awskii commented Oct 30, 2024

So we keep cursor interface opened inside DomainRoTx. If we then create new tx and try to read with it from DomainRoTx, 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.

@AskAlexSharov
Copy link
Collaborator

AskAlexSharov commented Oct 31, 2024

@awskii maybe we must panic in this case? just to enforce next invariant:

  • temporal.Tx guarantee that lifetime of dbtx is longer than lifteme of aggtx
  • not allowed to move between goroutines: tx, aggtx, doms

@awskii
Copy link
Member Author

awskii commented Oct 31, 2024

@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.

@AskAlexSharov
Copy link
Collaborator

sharedDomains without closing and reopening (requires only to set up new aggtx) where do you need it?

@awskii
Copy link
Member Author

awskii commented Nov 1, 2024

i found it useful while did commitment rebuilding. I am going to add panic as you said.

@awskii awskii changed the title Close cursor if it's opened by different tx [wip] Close cursor if it's opened by different tx Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants