멀티모듈 인프라: schema.d/ 분리 + acq.fd 범용필드 (병렬 팬아웃 충돌회피)

- db/schema.sql → db/schema.d/00-base.sql, compose가 schema.d 디렉터리 마운트
  (모듈들이 db/schema.d/NN-<mod>.sql 로 disjoint 추가)
- acq.fd에 범용 스크래치필드(T_ARG/T_STR/T_AMT/T_KEY/T_ID) → 모듈이 acq.fd 미수정
- setapp.sh gitignore 제외(필수 런타임 config)
- 검증: 4서버 runok, 41서비스, 체인 커밋 유지

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
forge-bot 2026-07-19 09:40:13 +00:00
parent 05a0ff3e56
commit 8219b85f14
6 changed files with 69 additions and 2 deletions

1
.gitignore vendored
View file

@ -23,4 +23,3 @@ app/src/acquire.c
app/src/reconcile.c app/src/reconcile.c
app/src/settle.c app/src/settle.c
app/bin/ app/bin/
app/conf/setapp.sh

18
app/conf/setapp.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
# Source this to get the full Enduro/X + ECPG/XA runtime environment.
# Used by entrypoint.sh (to boot) and by the driver run (to tpcall).
export NDRX_APPHOME=/app
export NDRX_CCONFIG=/app/conf/app.ini
export PATH=/app/bin:/usr/local/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# --- ECPG XA resource manager (PostgreSQL), coordinated by tmsrv ---------------
# The XA switch (libndrxxaecpg.so) opens the DB connection at tpopen(); there is
# NO explicit EXEC SQL CONNECT anywhere. Host "db" is the compose service name.
export NDRX_XA_RES_ID=1
export NDRX_XA_DRIVERLIB=libndrxxaecpg.so
export NDRX_XA_RMLIB=-
export NDRX_XA_LAZY_INIT=1
export NDRX_XA_OPEN_STR='{ "url":"tcp:postgresql://db/acq", "user":"acq", "password":"acq"}'
export NDRX_XA_CLOSE_STR="$NDRX_XA_OPEN_STR"

View file

@ -27,3 +27,29 @@ T_SVCNAME 22 string - 서비스명
T_RC 23 long - 결과코드 T_RC 23 long - 결과코드
T_GROSS 24 long - 총액 T_GROSS 24 long - 총액
T_DOCNO 25 string - 문서번호 T_DOCNO 25 string - 문서번호
# --- 범용 스크래치 필드 (모듈들이 acq.fd 수정 없이 재사용; 병렬 생성 충돌 회피) ---
T_ARG1 30 long - 범용 long 1
T_ARG2 31 long - 범용 long 2
T_ARG3 32 long - 범용 long 3
T_ARG4 33 long - 범용 long 4
T_ARG5 34 long - 범용 long 5
T_ARG6 35 long - 범용 long 6
T_ARG7 36 long - 범용 long 7
T_ARG8 37 long - 범용 long 8
T_STR1 38 string - 범용 string 1
T_STR2 39 string - 범용 string 2
T_STR3 40 string - 범용 string 3
T_STR4 41 string - 범용 string 4
T_STR5 42 string - 범용 string 5
T_STR6 43 string - 범용 string 6
T_STR7 44 string - 범용 string 7
T_STR8 45 string - 범용 string 8
T_AMT1 46 long - 범용 금액 1
T_AMT2 47 long - 범용 금액 2
T_AMT3 48 long - 범용 금액 3
T_AMT4 49 long - 범용 금액 4
T_KEY1 50 string - 범용 키 1
T_KEY2 51 string - 범용 키 2
T_ID1 52 long - 범용 ID 1
T_ID2 53 long - 범용 ID 2

View file

@ -26,3 +26,27 @@
#define T_RC ((BFLDID32)33560455) /* number: 6023 type: long */ #define T_RC ((BFLDID32)33560455) /* number: 6023 type: long */
#define T_GROSS ((BFLDID32)33560456) /* number: 6024 type: long */ #define T_GROSS ((BFLDID32)33560456) /* number: 6024 type: long */
#define T_DOCNO ((BFLDID32)167778185) /* number: 6025 type: string */ #define T_DOCNO ((BFLDID32)167778185) /* number: 6025 type: string */
#define T_ARG1 ((BFLDID32)33560462) /* number: 6030 type: long */
#define T_ARG2 ((BFLDID32)33560463) /* number: 6031 type: long */
#define T_ARG3 ((BFLDID32)33560464) /* number: 6032 type: long */
#define T_ARG4 ((BFLDID32)33560465) /* number: 6033 type: long */
#define T_ARG5 ((BFLDID32)33560466) /* number: 6034 type: long */
#define T_ARG6 ((BFLDID32)33560467) /* number: 6035 type: long */
#define T_ARG7 ((BFLDID32)33560468) /* number: 6036 type: long */
#define T_ARG8 ((BFLDID32)33560469) /* number: 6037 type: long */
#define T_STR1 ((BFLDID32)167778198) /* number: 6038 type: string */
#define T_STR2 ((BFLDID32)167778199) /* number: 6039 type: string */
#define T_STR3 ((BFLDID32)167778200) /* number: 6040 type: string */
#define T_STR4 ((BFLDID32)167778201) /* number: 6041 type: string */
#define T_STR5 ((BFLDID32)167778202) /* number: 6042 type: string */
#define T_STR6 ((BFLDID32)167778203) /* number: 6043 type: string */
#define T_STR7 ((BFLDID32)167778204) /* number: 6044 type: string */
#define T_STR8 ((BFLDID32)167778205) /* number: 6045 type: string */
#define T_AMT1 ((BFLDID32)33560478) /* number: 6046 type: long */
#define T_AMT2 ((BFLDID32)33560479) /* number: 6047 type: long */
#define T_AMT3 ((BFLDID32)33560480) /* number: 6048 type: long */
#define T_AMT4 ((BFLDID32)33560481) /* number: 6049 type: long */
#define T_KEY1 ((BFLDID32)167778210) /* number: 6050 type: string */
#define T_KEY2 ((BFLDID32)167778211) /* number: 6051 type: string */
#define T_ID1 ((BFLDID32)33560484) /* number: 6052 type: long */
#define T_ID2 ((BFLDID32)33560485) /* number: 6053 type: long */

View file

@ -10,7 +10,7 @@ services:
# XA / 2-phase commit needs prepared transactions enabled. # XA / 2-phase commit needs prepared transactions enabled.
command: ["-c", "max_prepared_transactions=100"] command: ["-c", "max_prepared_transactions=100"]
volumes: volumes:
- ../db/schema.sql:/docker-entrypoint-initdb.d/10-schema.sql:ro - ../db/schema.d:/docker-entrypoint-initdb.d:ro
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U acq -d acq"] test: ["CMD-SHELL", "pg_isready -U acq -d acq"]
interval: 3s interval: 3s