Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
We need txId (transaction ID) to have the following properties:
- Contain beginTs inside it so that we can extract beginTs from txId
- txId must be globally unique
- Its length must be 128 bits (to fit in UUID) - this requirement comes from the current implementation and it's not clear why exactly we need it
Current approach is to construct txId as a concatenation of txId prefix (aka nodeId) and beginTs taken as HLC.now() on the node that generates the txId. txId prefix must be unique among all coordinators. If we make it unique among all nodes in the logical topology, this solves our problem.
We need to design and implement a way to choose a unique txId prefix. We probably need to validate this value on join to make sure it's unique. On the generation, here are some ideas:
- Use MAC address to generate the prefix (but MAC addresses are not unique; we not always have access to MAC address; more than one Ignite nodes might be started on the same machine; we need to hash the MAC to fit in 32 bits, so collisions may happen even with different MACs)
- Use hash code from consistentId (this could lead to a necessity to change it by the user if a collision happens)
- Generate txId prefix using a cluster-global cyclic 32 bit counter on join (the downside is that it looks like an additional ID [additional to consistentId])
- Use the approach from the previous item to replace consistentId (and so remove consistentId from the system completely)
Attachments
Issue Links
- is related to
-
IGNITE-19225 Generate beginTs on a coordinator and send it to all tx participants
- Resolved