Skip to content

Support rebind connection(session) to original threadgroup#14

Merged
zhangh43 merged 1 commit intoeloqdata:mainfrom
xiexiaoy:rebind_conn
Jul 16, 2025
Merged

Support rebind connection(session) to original threadgroup#14
zhangh43 merged 1 commit intoeloqdata:mainfrom
xiexiaoy:rebind_conn

Conversation

@xiexiaoy
Copy link
Collaborator

Sessions of MongoDB are logical, meaning they are allowed to cross connections. However, transactions in EloqDoc are bound to a ThreadGroup that creates them, and connections in EloqDoc are bound to a ThreadGroup when the connection is accepted.

  1. Store the original ThreadGroupId in the Session object.
  2. Get the current ThreadGroupId from the ServiceStateMachine(connection) object and the original ThreadGroupId from the Session object.
  3. Compare the current ThreadGroupId and the original ThreadGroupId.
  4. If they are different, reset the ThreadGroupId of ServiceStateMachine and forward continuation to the original ThreadGroup.
  5. Rebind is unnecessary if the incoming command is not inside a transaction.

@xiexiaoy xiexiaoy marked this pull request as ready for review July 16, 2025 06:05
@zhangh43 zhangh43 merged commit 9ed840d into eloqdata:main Jul 16, 2025
1 check passed
@xiexiaoy xiexiaoy deleted the rebind_conn branch July 16, 2025 07:10
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