Skip to content

Commit b9cfe18

Browse files
committed
Move DTMD and Sockhub to a separate contrib dir. Name it Arbiter.
Improve the usage manual in the arbiter launcher.
1 parent 36e27a3 commit b9cfe18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+199
-845
lines changed
File renamed without changes.

contrib/arbiter/Makefile

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
top_builddir = ../..
2+
include $(top_builddir)/src/Makefile.global
3+
4+
override CFLAGS += -fPIC
5+
override CPPFLAGS += -I. -Iinclude -Iapi -D_LARGEFILE64_SOURCE
6+
7+
AR = ar
8+
ARFLAGS = -cru
9+
10+
SOCKHUB_PREFIX=sockhub
11+
SOCKHUB_CFLAGS=-I"$(SOCKHUB_PREFIX)"
12+
13+
SYSTEM=$(shell uname -s)
14+
ifeq ($(SYSTEM),Darwin)
15+
CFLAGS += -D_DARWIN_C_SOURCE
16+
endif
17+
18+
.PHONY: all clean check bindir objdir libdir
19+
20+
all: bin/arbiter bin/heart lib/libarbiter.a
21+
@echo Done.
22+
@echo Feel free to run the tests with \'make check\'.
23+
24+
lib/libarbiter.a: obj/api.o | libdir objdir
25+
$(AR) $(ARFLAGS) lib/libarbiter.a obj/api.o
26+
27+
bin/arbiter: obj/server.o obj/raft.o obj/main.o obj/clog.o obj/clogfile.o obj/util.o obj/transaction.o obj/snapshot.o obj/ddd.o | bindir objdir
28+
$(CC) -o bin/arbiter $(CFLAGS) $(CPPFLAGS) \
29+
obj/server.o obj/raft.o obj/main.o \
30+
obj/clog.o obj/clogfile.o obj/util.o obj/transaction.o \
31+
obj/snapshot.o obj/ddd.o
32+
33+
bin/heart: obj/heart.o obj/raft.o obj/util.o | bindir objdir
34+
$(CC) -o bin/heart $(CFLAGS) $(CPPFLAGS) \
35+
obj/heart.o obj/raft.o obj/util.o \
36+
obj/snapshot.o \
37+
$(SOCKHUB_LDFLAGS)
38+
39+
obj/api.o: api/arbiter.c | objdir
40+
$(CC) -c -o obj/api.o $(CFLAGS) $(CPPFLAGS) $(SOCKHUB_CFLAGS) api/arbiter.c
41+
42+
obj/server.o: src/server.c | objdir
43+
$(CC) -c -o obj/server.o $(CFLAGS) $(CPPFLAGS) $(SOCKHUB_CFLAGS) src/server.c
44+
45+
check: bin/util-test bin/clog-test
46+
./check.sh util clog
47+
48+
obj/%.o: src/%.c | objdir
49+
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
50+
51+
bin/util-test: obj/util-test.o obj/util.o | bindir
52+
$(CC) -o bin/util-test $(CFLAGS) $(CPPFLAGS) obj/util-test.o obj/util.o
53+
54+
bin/clog-test: obj/clog-test.o obj/clog.o obj/clogfile.o obj/util.o | bindir
55+
$(CC) -o bin/clog-test $(CFLAGS) $(CPPFLAGS) obj/clog-test.o obj/clog.o obj/clogfile.o obj/util.o
56+
57+
bindir:
58+
mkdir -p bin
59+
60+
objdir:
61+
mkdir -p obj
62+
63+
libdir:
64+
mkdir -p lib
65+
66+
clean:
67+
rm -rfv bin obj lib test.log

contrib/pg_dtm/dtmd/README renamed to contrib/arbiter/README

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
===
2-
xtm
3-
===
1+
=======
2+
Arbiter
3+
=======
44

5-
Distributed transaction management tools for PostgreSQL.
5+
Arbiter is a daemon responsible for distributed transaction management.
6+
It implements the XTM protocol.
67

78
--------------------
89
Communication scheme
910
--------------------
10-
┏━━━━━━━━━┓
11-
┌────────┨ Backend ┠──────────┐
12-
│ ┗━━━━━━━━━┛ │
13-
┏━━━━┷━━━━┓ ┏━━━━━━━━━┓ ┏━━━━━━┷━━━━━━┓
14-
┃ Arbiter ┠───┨ Backend ┠───┨ Coordinator ┃
15-
┗━━━━┯━━━━┛ ┗━━━━━━━━━┛ ┗━━━━━━┯━━━━━━┛
16-
│ ┏━━━━━━━━━┓ │
17-
└──┬─────┨ Backend ┠───────┬──┘
18-
┆ ┗━━━━━━━━━┛ ┆
19-
libdtm + libsockhub libpq + xtm procs
20-
21-
-----------------------
22-
Coordinator-Backend API
23-
-----------------------
24-
25-
This API includes a set of postgres procedures that
26-
the coordinator can call with "select" statement.
27-
28-
FIXME: actualize the API
11+
┏━━━━━━━━━┓
12+
┌────────┨ Backend ┠──────────┐
13+
┏━━━┷━━━━━┓ ┗━━━━━━━━━┛ │
14+
┏┻━━━━━━━━┓┃ ┏━━━━━━━━━┓ ┏━━━━━━┷━━━━━━┓
15+
┏┻━━━━━━━━┓┣┹──┨ Backend ┠───┨ Coordinator ┃
16+
┃ Arbiter ┣┛ ┗━━━━━━━━━┛ ┗━━━━━━┯━━━━━━┛
17+
┗━━━━━┯━━━┛ ┏━━━━━━━━━┓ │
18+
└──┬─────┨ Backend ┠───────┬──┘
19+
┆ ┗━━━━━━━━━┛ ┆
20+
libarbiter + libsockhub libpq + xtm procs
21+
22+
---
23+
API
24+
---
25+
26+
For the API see the contents of 'include/api.h', it is packed with comments.
27+
Compile with '-larbiter'.
2928

3029
------------------------
3130
Backend-Arbiter Protocol

0 commit comments

Comments
 (0)