Phase 2b: 11개 모듈 전량 실동작 (333 서비스, 전서버 부팅)

- 10개 모듈 추가/확장(au py rc st lg cl mm vl mg cm), 각 30 서비스 = 330 + tmsrv
- build.sh 자동발견으로 11 모듈서버 + dbio 라이브러리 23 + 배치 22 빌드
- schema.d 11파일 → 75 테이블, 모듈별 disjoint
- 부팅 리소스 규명: fs.mqueue.queues_max=8192(330큐>256), NDRX_MSGSIZEMAX 16000·
  MSGMAX 50(큐당 5.6MB→0.8MB), msgqueue ulimit 2GB → 전 12서버 runok
- 검증: xadmin psc 333 AVAIL, 매입체인 XA 커밋, prepared_xacts=0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
forge-bot 2026-07-19 09:58:39 +00:00
parent 8219b85f14
commit bec83c721e
73 changed files with 10705 additions and 35 deletions

51
db/schema.d/45-cl.sql Normal file
View file

@ -0,0 +1,51 @@
-- ---------------------------------------------------------------------------
-- cl 모듈 (마감/closing) - 일/월/분기/연 마감 로그 + 스냅샷 + 기간잠금 (prefix 45)
-- Loaded after 40-lg.sql by docker-entrypoint-initdb.d.
-- cl 서비스/배치가 채우는 마감이력(close_log) + 마감스냅샷(snapshot) 테이블.
-- ---------------------------------------------------------------------------
-- 마감 이력 (close_log) - 하나의 마감 실행(일/월/분기/연/중간)의 헤더
CREATE SEQUENCE IF NOT EXISTS cl_close_seq;
CREATE TABLE IF NOT EXISTS cl_close_log (
close_id BIGINT PRIMARY KEY,
close_type TEXT NOT NULL, -- DAILY/MONTHLY/QUARTER/YEAREND/MID
period_key TEXT NOT NULL, -- YYYY-MM-DD / YYYY-MM / YYYY-Qn / YYYY
biz_date DATE NOT NULL,
status TEXT NOT NULL DEFAULT 'O', -- O=개시, C=마감완료, R=재마감, A=승인, L=잠금, X=취소
txn_count BIGINT NOT NULL DEFAULT 0,
total_amount BIGINT NOT NULL DEFAULT 0,
memo TEXT NOT NULL DEFAULT '',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS ix_cl_close_period ON cl_close_log(close_type, period_key);
-- 마감 스냅샷 (snapshot) - 마감 시점 가맹점별 집계 고정
CREATE SEQUENCE IF NOT EXISTS cl_snapshot_seq;
CREATE TABLE IF NOT EXISTS cl_snapshot (
snapshot_id BIGINT PRIMARY KEY,
close_id BIGINT NOT NULL,
period_key TEXT NOT NULL,
biz_date DATE NOT NULL,
merchant_id TEXT NOT NULL,
gross_amount BIGINT NOT NULL DEFAULT 0,
fee_amount BIGINT NOT NULL DEFAULT 0,
net_amount BIGINT NOT NULL DEFAULT 0,
txn_count BIGINT NOT NULL DEFAULT 0,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS ix_cl_snapshot_close ON cl_snapshot(close_id);
-- 기간 잠금 (period lock) - 마감된 기간의 추가 정정 차단
CREATE TABLE IF NOT EXISTS cl_period_lock (
period_key TEXT PRIMARY KEY,
locked BOOLEAN NOT NULL DEFAULT true,
locked_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
-- 마감 시퀀스 관리 (close_type 별 마지막 순번)
CREATE TABLE IF NOT EXISTS cl_seq_reg (
close_type TEXT PRIMARY KEY,
last_seq BIGINT NOT NULL DEFAULT 0,
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);