Skip to content

Commit cf6ae89

Browse files
committed
Update DTM readme.
1 parent bca1495 commit cf6ae89

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

contrib/pg_xtm/README

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
===
2-
dtm
2+
xtm
33
===
44

55
Distributed transaction management tools for PostgreSQL.
@@ -32,30 +32,37 @@ libdtm api
3232

3333
typedef unsigned long long xid_t;
3434

35+
typedef int NodeId;
36+
37+
typedef struct {
38+
TransactionId* xids;
39+
NodeId* nodes;
40+
int nNodes;
41+
} GlobalTransactionId;
42+
3543
// Connects to the specified DTM.
3644
DTMConn DtmConnect(char *host, int port);
3745

3846
// Disconnects from the DTM. Do not use the 'dtm' pointer after this call, or
3947
// bad things will happen.
4048
void DtmDisconnect(DTMConn dtm);
4149

42-
// Asks DTM for a fresh snapshot. Returns a snapshot on success, or NULL
43-
// otherwise. Please free the snapshot memory yourself after use.
44-
Snapshot DtmGlobalGetSnapshot(DTMConn dtm);
45-
46-
// Starts a transaction. Returns the 'gxid' on success, or INVALID_GXID otherwise.
47-
xid_t DtmGlobalBegin(DTMConn dtm);
48-
49-
// Marks a given transaction as 'committed'. Returns 'true' on success,
50+
// Creates an entry for a new global transaction. Returns 'true' on success, or
5051
// 'false' otherwise.
51-
bool DtmGlobalCommit(DTMConn dtm, xid_t gxid);
52+
bool DtmGlobalStartTransaction(DTMConn dtm, GlobalTransactionId* gtid);
53+
54+
// Asks DTM for a fresh snapshot. Returns 'true' on success, or 'false'
55+
// otherwise.
56+
bool DtmGlobalGetSnapshot(DTMConn dtm, NodeId nodeid, TransactionId xid, Snapshot snapshot);
5257

53-
// Marks a given transaction as 'aborted'.
54-
void DtmGlobalRollback(DTMConn dtm, xid_t gxid);
58+
// Commits transaction only once all participants have called this function,
59+
// does not change CLOG otherwise. Returns 'true' on success, 'false' if
60+
// something failed on the daemon side.
61+
bool DtmGlobalSetTransStatus(DTMConn dtm, NodeId nodeid, TransactionId xid, XidStatus status);
5562

56-
// Gets the status of the transaction identified by 'gxid'. Returns the status
63+
// Gets the status of the transaction identified by 'xid'. Returns the status
5764
// on success, or -1 otherwise.
58-
int DtmGlobalGetTransStatus(DTMConn dtm, xid_t gxid);
65+
XidStatus DtmGlobalGetTransStatus(DTMConn dtm, NodeId nodeid, TransactionId xid);
5966

6067
--------------------
6168
Backend-DTM Protocol
@@ -80,11 +87,8 @@ DTM <--> Backend:
8087
-> '-' - "something went wrong"
8188

8289
<- 's'<hex16 gxid> - "status"
83-
-> '+''c|a|?' - "here is the transaction status"
84-
(c)ommitted, (a)borted or (?)unknown
90+
-> '+''0|c|a|?' - "here is the transaction status"
91+
(0)unknown, (c)committed, (a)aborted, or (?)inprogress
8592
-> '-' - "something went wrong"
8693

8794
<snapshot> = <hex16 xmin><hex16 xmax><hex16 n><hex16 active[n]>
88-
89-
Backend disconnection is considered as an abort of all incomplete transactions
90-
started by that backend.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy