Skip to content

Commit 0360372

Browse files
committed
Change xit_t to 32 bit
1 parent d0adde3 commit 0360372

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

contrib/pg_dtm/dtmd/include/clog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#define INVALID_XID 0
1212
#define MIN_XID 42
13-
#define MAX_XID 0xdeadbeefcafebabe
13+
#define MAX_XID ~0
1414

1515
#define BLANK 0
1616
#define POSITIVE 1

contrib/pg_dtm/dtmd/include/int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef INT_H
22
#define INT_H
33

4-
typedef unsigned long long xid_t;
4+
typedef unsigned xid_t;
55

66
#endif

contrib/pg_dtm/dtmd/src/clog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int clog_read(clog_t clog, xid_t xid) {
120120
return status;
121121
} else {
122122
shout(
123-
"xid %016llx status is out of range, "
123+
"xid %016x status is out of range, "
124124
"you might be experiencing a bug in backend\n",
125125
xid
126126
);

contrib/pg_dtm/dtmd/src/main.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static void ondisconnect(client_t client) {
117117
transactions_count--;
118118
} else {
119119
shout(
120-
"[%d] DISCONNECT: transaction %llu"
120+
"[%d] DISCONNECT: transaction %u"
121121
" failed to abort O_o\n",
122122
CLIENT_ID(client), t->xid
123123
);
@@ -128,7 +128,7 @@ static void ondisconnect(client_t client) {
128128

129129
if (i < 0) {
130130
shout(
131-
"[%d] DISCONNECT: transaction %llu not found O_o\n",
131+
"[%d] DISCONNECT: transaction %u not found O_o\n",
132132
CLIENT_ID(client), CLIENT_XID(client)
133133
);
134134
}
@@ -154,7 +154,7 @@ static void debug_cmd(client_t client, int argc, xid_t *argv) {
154154
debug("[%d] %s", CLIENT_ID(client), cmdname);
155155
int i;
156156
for (i = 1; i < argc; i++) {
157-
debug(" %llu", argv[i]);
157+
debug(" %u", argv[i]);
158158
}
159159
debug("\n");
160160
}
@@ -209,14 +209,14 @@ static void onreserve(client_t client, int argc, xid_t *argv) {
209209
xid_t maxxid = minxid + minsize - 1;
210210

211211
debug(
212-
"[%d] RESERVE: asked for range %llu-%llu\n",
212+
"[%d] RESERVE: asked for range %u-%u\n",
213213
CLIENT_ID(client),
214214
minxid, maxxid
215215
);
216216

217217
if ((prev_gxid >= minxid) || (maxxid >= next_gxid)) {
218218
debug(
219-
"[%d] RESERVE: local range %llu-%llu is not between global range %llu-%llu\n",
219+
"[%d] RESERVE: local range %u-%u is not between global range %u-%u\n",
220220
CLIENT_ID(client),
221221
minxid, maxxid,
222222
prev_gxid, next_gxid
@@ -227,7 +227,7 @@ static void onreserve(client_t client, int argc, xid_t *argv) {
227227
next_gxid = maxxid + 1;
228228
}
229229
debug(
230-
"[%d] RESERVE: allocating range %llu-%llu\n",
230+
"[%d] RESERVE: allocating range %u-%u\n",
231231
CLIENT_ID(client),
232232
minxid, maxxid
233233
);
@@ -289,7 +289,7 @@ static void onbegin(client_t client, int argc, xid_t *argv) {
289289

290290
if (!clog_write(clg, t->xid, DOUBT)) {
291291
shout(
292-
"[%d] BEGIN: transaction %llu failed"
292+
"[%d] BEGIN: transaction %u failed"
293293
" to initialize clog bits O_o\n",
294294
CLIENT_ID(client), t->xid
295295
);
@@ -335,7 +335,7 @@ static bool queue_for_transaction_finish(client_t client, xid_t xid, char cmd) {
335335
Transaction *t = find_transaction(xid);
336336
if (t == NULL) {
337337
shout(
338-
"[%d] QUEUE: xid %llu not found\n",
338+
"[%d] QUEUE: xid %u not found\n",
339339
CLIENT_ID(client), xid
340340
);
341341
client_message_shortcut(client, RES_FAILED);
@@ -366,7 +366,7 @@ static void onvote(client_t client, int argc, xid_t *argv, int vote) {
366366
Transaction *t = find_transaction(xid);
367367
if (t == NULL) {
368368
shout(
369-
"[%d] VOTE: xid %llu not found\n",
369+
"[%d] VOTE: xid %u not found\n",
370370
CLIENT_ID(client), xid
371371
);
372372
client_message_shortcut(client, RES_FAILED);
@@ -441,7 +441,7 @@ static void onsnapshot(client_t client, int argc, xid_t *argv) {
441441
Transaction *t = find_transaction(xid);
442442
if (t == NULL) {
443443
shout(
444-
"[%d] SNAPSHOT: xid %llu not found\n",
444+
"[%d] SNAPSHOT: xid %u not found\n",
445445
CLIENT_ID(client), xid
446446
);
447447
client_message_shortcut(client, RES_FAILED);
@@ -529,7 +529,7 @@ static void onstatus(client_t client, int argc, xid_t *argv) {
529529

530530
static void onnoise(client_t client, int argc, xid_t *argv) {
531531
shout(
532-
"[%d] NOISE: unknown command '%c' (%lld)\n",
532+
"[%d] NOISE: unknown command '%c' (%d)\n",
533533
CLIENT_ID(client),
534534
(char)argv[0], argv[0]
535535
);

contrib/pg_dtm/dtmd/src/snapshot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//}
1111

1212
static void append_hex16(char **cursorp, xid_t value) {
13-
int written = sprintf(*cursorp, "%016llx", value);
13+
int written = sprintf(*cursorp, "%016x", value);
1414
assert(written == 16);
1515
*cursorp += written;
1616
}

contrib/pg_dtm/libdtm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static char *dtmhost = NULL;
3131
static int dtmport = 0;
3232
static char* dtm_unix_sock_dir;
3333

34-
typedef unsigned long long xid_t;
34+
typedef unsigned xid_t;
3535

3636
// Connects to the specified DTM.
3737
static DTMConn DtmConnect(char *host, int port)

contrib/pg_dtm/tests/transfers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ go run transfers.go \
55
-d 'dbname=postgres port=5433' \
66
-v \
77
-m \
8-
-u 1000 \
8+
-u 10000 \
99
-w 10 \
1010
-g

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