Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ END

# store all pg options that have impact on cmd line initdb/boot
cat > ${PGROOT}/pgopts.sh <<END
export CDEBUG=$CDEBUG
export LDEBUG=$LDEBUG
export PGDEBUG=$PGDEBUG
export CDEBUG="$CDEBUG"
export LDEBUG="$LDEBUG"
export PGDEBUG="$PGDEBUG"
export PG_DEBUG_HEADER=$PG_DEBUG_HEADER
export PGOPTS="\\
-c log_checkpoints=false \\
Expand Down
38 changes: 23 additions & 15 deletions patches/interactive_one.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ static void io_init(bool in_auth, bool out_auth) {
whereToSendOutput = DestRemote; /* now safe to ereport to client */
MyProcPort = (Port *) calloc(1, sizeof(Port));
if (!MyProcPort) {
PDEBUG("# 131 io_init --------- NO CLIENT (oom) ---------");
PDEBUG("# 133: io_init --------- NO CLIENT (oom) ---------");
abort();
}
MyProcPort->canAcceptConnections = CAC_OK;
ClientAuthInProgress = out_auth;

SOCKET_FILE = NULL;
SOCKET_DATA = 0;
PDEBUG("# 139 io_init --------- CLIENT (ready) ---------");
PDEBUG("# 141: io_init --------- CLIENT (ready) ---------");


}
Expand All @@ -147,7 +147,7 @@ static void wait_unlock() {
int busy = 0;
while (access(PGS_OLOCK, F_OK) == 0) {
if (!(busy++ % 1110222))
printf("FIXME: busy wait lock removed %d\n", busy);
printf("# 150: FIXME: busy wait lock removed %d\n", busy);
}
}

Expand Down Expand Up @@ -263,9 +263,9 @@ interactive_one() {

if (!firstchar) {
if (ProcessStartupPacket(MyProcPort, true, true) != STATUS_OK) {
PDEBUG("# 274: ProcessStartupPacket !OK");
PDEBUG("# 266: ProcessStartupPacket !OK");
} else {
PDEBUG("# 276: auth request");
PDEBUG("# 267: auth request");
//ClientAuthentication(MyProcPort);
ClientAuthInProgress = true;
md5Salt[0]=0x01;
Expand Down Expand Up @@ -317,6 +317,8 @@ interactive_one() {

PDEBUG("# 324 : TODO: set a pg_main started flag");
sf_connected++;
// CHECK ME see 538 / 563
send_ready_for_query = true;
} // auth
} else {
#if PGDEBUG
Expand All @@ -342,12 +344,11 @@ PDEBUG("# 324 : TODO: set a pg_main started flag");
if (!firstchar || (firstchar==112)) {
PDEBUG("# 351: handshake/auth skip");
goto wire_flush;
// return;
}

/* else it is wire msg */
#if PGDEBUG
printf("# 362 : node+repl is wire : %c\n", firstchar);
printf("# 352 : node+repl is wire : %c\n", firstchar);
force_echo = true;
#endif
is_socket = true;
Expand Down Expand Up @@ -491,14 +492,16 @@ printf("# 362 : node+repl is wire : %c\n", firstchar);
goto wire_flush;
}
RESUME_INTERRUPTS();

send_ready_for_query = true;
return;
}

PG_exception_stack = &local_sigjmp_buf;
#endif

if (force_echo) {
printf("# 524: wire=%d socket=%d repl=%c: %s", is_wire, is_socket, firstchar, inBuf->data);
printf("# 501: wire=%d socket=%d repl=%c: %s", is_wire, is_socket, firstchar, inBuf->data);
}


Expand Down Expand Up @@ -528,14 +531,17 @@ printf("# 362 : node+repl is wire : %c\n", firstchar);

if (is_wire) {
wire_flush:
if (SOCKET_DATA>0) {
if (!ClientAuthInProgress) {
PDEBUG("# 529: end packet - sending rfq");
if (!ClientAuthInProgress) {
PDEBUG("# 537: end packet - sending rfq");
if (send_ready_for_query) {
ReadyForQuery(DestRemote);
} else {
PDEBUG("# 532: end packet (ClientAuthInProgress - no rfq) ");
send_ready_for_query = false;
}
} else {
PDEBUG("# 542: end packet (ClientAuthInProgress - no rfq) ");
}

if (SOCKET_DATA>0) {
if (sockfiles) {
if (cma_wsize)
puts("ERROR: cma was not flushed before socketfile interface");
Expand All @@ -548,13 +554,15 @@ printf("# 362 : node+repl is wire : %c\n", firstchar);
SOCKET_FILE = NULL;
SOCKET_DATA = 0;
if (cma_wsize)
PDEBUG("# 551: cma and sockfile ???");
PDEBUG("# 557: cma and sockfile ???");
if (sockfiles) {
PDEBUG("# 553: setting sockfile lock, ready to read");
PDEBUG("# 559: setting sockfile lock, ready to read");
PDEBUG(PGS_OLOCK);
c_lock = fopen(PGS_OLOCK, "w");
fclose(c_lock);
}
// CHECK ME 320 / 540 . only initially or after error
// send_ready_for_query = true;
}

} else {
Expand Down