Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1c1434b

Browse files
committed
cleanup dtm_recovery
1 parent8faeba7 commit1c1434b

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

‎contrib/pg_tsdtm/dtm_recovery/dtm_recovery.cpp‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ int main (int argc, char* argv[])
2020
set<string> prepared_xacts;
2121
set<string> committed_xacts;
2222
bool verbose =false;
23-
for (int i =1; i < argc; i++) {
24-
if (argv[i][0] =='-') {
25-
switch (argv[i][1]) {
23+
for (int i =1; i < argc; i++) {
24+
if (argv[i][0] =='-') {
25+
switch (argv[i][1]) {
2626
case'C':
2727
case'c':
2828
connections.push_back(string(argv[++i]));
@@ -39,12 +39,12 @@ int main (int argc, char* argv[])
3939
"\t-v\tverbose mode: print extra information while processing\n");
4040
return1;
4141
}
42-
if (verbose) {
42+
if (verbose) {
4343
cout <<"Collecting information about prepared transactions...\n";
4444
}
4545
for (vector<string>::iterator ic = connections.begin(); ic != connections.end(); ++ic)
4646
{
47-
if (verbose) {
47+
if (verbose) {
4848
cout <<"Connecting to" << *ic <<"...\n";
4949
}
5050
connectioncon(*ic);
@@ -57,17 +57,17 @@ int main (int argc, char* argv[])
5757
}
5858
txn.commit();
5959
}
60-
if (verbose) {
60+
if (verbose) {
6161
cout <<"Prepared transactions:";
6262
for (set<string>::iterator it = prepared_xacts.begin(); it != prepared_xacts.end(); ++it)
6363
{
6464
cout << *it <<",";
6565
}
6666
cout <<"\nChecking which of them are committed...\n";
67-
}
67+
}
6868
for (vector<string>::iterator ic = connections.begin(); ic != connections.end(); ++ic)
6969
{
70-
if (verbose) {
70+
if (verbose) {
7171
cout <<"Connecting to" << *ic <<"...\n";
7272
}
7373
connectioncon(*ic);
@@ -83,17 +83,17 @@ int main (int argc, char* argv[])
8383
}
8484
txn.commit();
8585
}
86-
if (verbose) {
86+
if (verbose) {
8787
cout <<"Committed transactions:";
8888
for (set<string>::iterator it = committed_xacts.begin(); it != committed_xacts.end(); ++it)
8989
{
9090
cout << *it <<",";
9191
}
9292
cout <<"\nCommitting them at all nodes...\n";
93-
}
93+
}
9494
for (vector<string>::iterator ic = connections.begin(); ic != connections.end(); ++ic)
9595
{
96-
if (verbose) {
96+
if (verbose) {
9797
cout <<"Connecting to" << *ic <<"...\n";
9898
}
9999
connectioncon(*ic);
@@ -108,12 +108,12 @@ int main (int argc, char* argv[])
108108
result rc = txn.prepared("commit-check")(gid).exec();
109109
if (rc.empty()) {
110110
if (committed_xacts.find(gid) != committed_xacts.end()) {
111-
if (verbose) {
111+
if (verbose) {
112112
cout <<"Commit transaction" << gid <<"\n";
113113
}
114114
txn.prepared("commit-prepared")(gid);
115-
}else {
116-
if (verbose) {
115+
}else {
116+
if (verbose) {
117117
cout <<"Rollback transaction" << gid <<"\n";
118118
}
119119
txn.prepared("rollback-prepared")(gid);
@@ -122,8 +122,8 @@ int main (int argc, char* argv[])
122122
}
123123
txn.commit();
124124
}
125-
if (verbose) {
125+
if (verbose) {
126126
cout <<"Recovery completed\n";
127127
}
128128
return0;
129-
}
129+
}

‎contrib/pg_tsdtm/dtm_recovery/makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX=g++
2-
CXXFLAGS=-g -Wall -O0 -pthread
2+
CXXFLAGS=-g -Wall -O0 -pthread
33

44
all: dtm_recovery
55

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp