forked from kelvich/pg_tsdtm
postgrespro/pg_tsdtm
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
This branch is 54 commits ahead of kelvich:master.
Latest commit
Git stats
Files
Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
===
dtm
===
Distributed transaction management tools for PostgreSQL.
--------------------
Communication scheme
--------------------
.- Backend -.
/ \
/ \
DTM ---- Backend ---- Coordinator
\ /
\ /
`- Backend -´
-----------------------
Coordinator-Backend API
-----------------------
This API includes a set of postgres procedures that
the coordinator can call with "select" statement.
extend_transaction (n integer) -> (higcid gcid)
join_transaction (higcid gcid) -> ()
FIXME: add procedures that would start and finish 2pc
----------
libdtm api
----------
typedef unsigned long long cid_t;
// Connects to the specified DTM.
DTMConn DtmConnect(char *host, int port);
// Disconnects from the DTM. Do not use the 'dtm' pointer after this call, or
// bad things will happen.
void DtmDisconnect(DTMConn dtm);
// Asks DTM for the first 'gcid' with unknown status. This 'gcid' is used as a
// kind of snapshot. Returns the 'gcid' on success, or INVALID_GCID otherwise.
cid_t DtmGlobalGetNextCid(DTMConn dtm);
// Prepares a commit. Returns the 'gcid' on success, or INVALID_GCID otherwise.
cid_t DtmGlobalPrepare(DTMConn dtm);
// Finishes a given commit with 'committed' status. Returns 'true' on success,
// 'false' otherwise.
bool DtmGlobalCommit(DTMConn dtm, cid_t gcid);
// Finishes a given commit with 'aborted' status.
void DtmGlobalRollback(DTMConn dtm, cid_t gcid);
// Gets the status of the commit identified by 'gcid'. Returns the status on
// success, or -1 otherwise.
int DtmGlobalGetTransStatus(DTMConn dtm, cid_t gcid);
--------------------
Backend-DTM Protocol
--------------------
DTM <--> Backend:
<- 'p'<hex16 self> - "prepare"
-> '+'<hex16 gcid> - "commit prepared"
-> '-' - "something went wrong"
<- 'c'<hex16 gcid> - "commit"
-> '+' - "commit saved"
-> '-' - "something went wrong"
<- 'a'<hex16 gcid> - "abort"
-> '+' - "abort saved"
-> '-' - "something went wrong"
<- 'h' - "horizon"
-> '+'<hex16 gcid> - "here is a gcid you can use as a snapshot"
-> '-' - "something went wrong"
<- 's'<hex16 gcid> - "status"
-> '+''c|a|?' - "here is the transaction status"
(c)ommitted, (a)borted or (?)unknown
-> '-' - "something went wrong"
Backend disconnection is considered as an abort of all incomplete commits
prepared by that backend.
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- C 39.3%
- Go 32.4%
- C++ 24.1%
- Shell 2.1%
- SQLPL 1.3%
- Makefile 0.8%