Phase 1: 실동작 Enduro/X + PostgreSQL XA 매입 슬라이스
- Enduro/X 7.0.12 소스빌드 이미지(-DENABLE_POSTGRES=ON, libndrxxaecpg XA 스위치) - docker-compose: postgres(max_prepared_transactions=100) + endurox app - ECPG XA 서비스 3종: ACQUIRE→RECONCILE→SETTLE (tpservice + EXEC SQL) - 클라이언트 tpbegin/tpcall체인/tpcommit → tmsrv 2PC(prepare/commit) 원자 커밋 - 검증: 서비스 AVAIL, 커밋 row(status=S) psql 확인, 롤백 시 무잔존, pg_prepared_xacts=0 - 규명된 런타임 요건: sysctl fs.mqueue.*, ulimit msgqueue/nofile, XA open-str JSON - docs/architecture.md, README, service-catalog 설계 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
e6e29e6b5d
19 changed files with 1005 additions and 0 deletions
75
app/entrypoint.sh
Executable file
75
app/entrypoint.sh
Executable file
|
|
@ -0,0 +1,75 @@
|
|||
#!/bin/bash
|
||||
##
|
||||
## Build + boot the Enduro/X acquiring slice, then stay alive.
|
||||
## Runs inside the app container (image acquire-x/endurox:7.0.12).
|
||||
##
|
||||
set -e
|
||||
|
||||
. /app/conf/setapp.sh
|
||||
|
||||
echo "=================================================================="
|
||||
echo " acquire-core-x : build + boot"
|
||||
echo "=================================================================="
|
||||
|
||||
# runtime dirs
|
||||
mkdir -p /app/log /app/tmp /app/tmlogs/rm1 /app/bin
|
||||
rm -f /app/log/*.log 2>/dev/null || true
|
||||
|
||||
# ensure posix mqueue is available (compose provides the sysctls/ulimits)
|
||||
if [ ! -d /dev/mqueue ]; then
|
||||
mkdir -p /dev/mqueue
|
||||
mount -t mqueue none /dev/mqueue 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 1. UBF field header from the field table
|
||||
# ---------------------------------------------------------------------------
|
||||
echo "--- mkfldhdr acq.fd ---"
|
||||
cd /app/ubftab
|
||||
FIELDTBLS=acq.fd FLDTBLDIR=/app/ubftab mkfldhdr acq.fd
|
||||
ls -l /app/ubftab/acq.fd.h
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 2. ECPG precompile + buildserver each .pgc (XA switch loaded via env, so
|
||||
# buildserver needs no -r; we just link ecpg + pq). buildclient the driver.
|
||||
# ---------------------------------------------------------------------------
|
||||
export CFLAGS="-I/app/ubftab -I/app/src -I$(pg_config --includedir)"
|
||||
PGLIB="-L$(pg_config --libdir) -lecpg -lpq"
|
||||
|
||||
cd /app/src
|
||||
build_svc () {
|
||||
local src="$1" bin="$2"
|
||||
echo "--- ecpg $src ---"
|
||||
ecpg -I/app/ubftab -o "/app/src/${src%.pgc}.c" "/app/src/$src"
|
||||
echo "--- buildserver -> $bin ---"
|
||||
buildserver -o "/app/bin/$bin" -f "/app/src/${src%.pgc}.c" -a "$PGLIB"
|
||||
}
|
||||
|
||||
build_svc acquire.pgc acqacquire
|
||||
build_svc reconcile.pgc acqreconcile
|
||||
build_svc settle.pgc acqsettle
|
||||
|
||||
echo "--- buildclient -> acqdrv ---"
|
||||
buildclient -o /app/bin/acqdrv -f /app/src/acqdrv.c
|
||||
|
||||
ls -l /app/bin
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 3. Boot Enduro/X
|
||||
# ---------------------------------------------------------------------------
|
||||
echo "--- xadmin down/start ---"
|
||||
xadmin down -y 2>/dev/null || true
|
||||
xadmin start -y
|
||||
|
||||
echo "--- xadmin psc (advertised services) ---"
|
||||
xadmin psc
|
||||
echo "--- xadmin ppm (processes) ---"
|
||||
xadmin ppm
|
||||
|
||||
echo "=================================================================="
|
||||
echo " acquire-core-x : UP. Run the driver with:"
|
||||
echo " docker compose -f docker/docker-compose.yml exec app /app/run-driver.sh"
|
||||
echo "=================================================================="
|
||||
|
||||
# keep the container (and the ndrxd daemon) alive
|
||||
tail -F /app/log/ndrxd.log
|
||||
Loading…
Add table
Add a link
Reference in a new issue