Skip to content

measure(r276): ㄷ(자연키 PK) 비용 — 삽입·읽기 거의 무비용, 재구성 pt-osc 약 16분 · 네이티브 약 100분 (EC2) - #851

Open
Khyojae wants to merge 5 commits into
mainfrom
measure/r276-natural-pk-cost
Open

Khyojae wants to merge 5 commits into
mainfrom
measure/r276-natural-pk-cost

Conversation

@Khyojae

@Khyojae Khyojae commented Nov 9, 2026

Copy link
Copy Markdown
Member

요약

#276 의 ㄷ(멱등 키를 PK 로) 후보를 «치르는 값 미측정» 으로 보류했었다. 설계 docs/decisions/r276-lock-root-cause-fix.md §5 대로 EC2 3라운드(11-08 ~ 11-09)로 쟀다.
결과: loadtest/results/r276-natpk-aws-2026-11-08/README.md, 설계 §5-6.

상시 비용(삽입·읽기)은 거의 없거나 이득이고, 비용은 한 번 치르는 PK 재구성에 몰려 있다.

단계 결과
① 삽입 (c7i.xlarge) 4조건 중 3곳 B +15~22%. 버퍼풀 초과 · 활성 세션 675 에서만 B −10%(디스크 읽기 3.2배), B′ ±0
② PK 재구성 (m6i.xlarge · 1,000만 행 · 약 21GB) 서버가 INPLACE·LOCK=NONE 을 받는다. pt-osc 975.7~977.5초 · binlog +17GB / 네이티브 5,958.9~5,996.5초 · binlog +0.85GB. 둘 다 쓰기 실패 0 · 최대 공백 1.2~1.35초
③ 읽기 세션 조회 차이 없음(데움 p50 4.85.2ms). id 단건 데움 +0.020.07ms

새로 안 것

  • 1차 라운드에서 네이티브 팔이 매판 실패한 원인 = ERROR 1799 (innodb_online_alter_log_max_size 기본 128MiB 초과, 약 2시간 돈 뒤 롤백). 2GiB 로 올려 통과 — 최소 필요값은 안 쟀다
  • 설계 §5 전제 정정 둘: 08-12 online-ddl 과 행 크기가 약 9배 달라 직접 비교 불가 · A 의 세션 조회는 idx_session_timestamp 가 아니라 uk_pose_event 를 탄다
  • 원인 미확인으로 남긴 것: 네이티브가 pt-osc 보다 약 6배 느린 이유 · 메모리 체제 p99 가 버퍼풀 초과 체제보다 7~8배 큰 역전 · 온라인 로그 최소 필요값

포함

  • rig: loadtest/r276-natpk/ (5e2497b → 70f91cd 재측정 rig → de7311c 스모크 모드)
  • 원본: 라운드별·호스트별 _out/ 과 natpk_round.log
  • 설계 문서 상태 줄 · §5-6 · 결정 로그 한 줄. main 의 결정 로그(ㄴ «모르는 것» 두 줄)와 충돌 → 둘 다 살려 병합

결정 아님

§5-1 의 «ㄷ 이 싸면 ㄴ 을 다시 연다» 조건이 걸린다. 다시 열지는 사용자 결정 — 이 PR 은 값까지만.
EC2 인스턴스는 전부 terminate 확인(Project=shadowfit-measure 남은 것 0).

🤖 Generated with Claude Code

Khyojae and others added 5 commits November 8, 2026 13:32
설계 docs/decisions/r276-lock-root-cause-fix.md §5. 로컬 i3 스모크(숫자는 안 믿음, rig 이 도는지만):
① 끝까지 통과 · ③ 끝까지 통과 · ② 사전 확인에서 서버가 INPLACE·LOCK=NONE 을 받음, 버림판 N·P 통과.
② 본판 r1 은 12:59 PC 가 통째로 멈춰(전원 버튼 강제 종료 2회, 블루스크린 없음) 결과 없음 —
rig 결함은 아니라 판단해 EC2 본 측정으로 바로 간다.

launch.sh — c7i.xlarge(①, 상한 360분) · m6i.xlarge(②③, 상한 600분·디스크 300GB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 오류를 로그에

11-08 라운드에서 팔 N 이 매판 1799(innodb_online_alter_log_max_size 초과)로 실패했고, 오류가
SQL() 의 stderr 경로로 빠져 *_ddl.log 가 비어 있었다. 상한에 걸려 ③ 도 못 돌렸다.

- phase2: 팔 N0 추가 · DDL 은 직접 불러 오류를 *_ddl.log 에 · 실패도 경과 초를 남김 · WRITER_SECS
  · 온라인 로그 한도·sort buffer·tmpdir 를 env.txt 에 · «No such file» 리다이렉트 순서 수정
- compose: --innodb-online-alter-log-max-size=${ONLINE_LOG_BYTES:-기본 128MiB}
- ec2_round/launch: 박스별 rig 설정 한 줄(__ENV__) · MODE=rerun — 박스 A(pt-osc 1판 → ③) · 박스 B(N·N0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…브 약 100분 (EC2)

설계 docs/decisions/r276-lock-root-cause-fix.md §5. EC2 3라운드(11-08 ~ 11-09), 결과 §5-6.

- ① 삽입: 4조건 중 3곳 B +15~22%, 버퍼풀 초과 · 활성 675 에서만 B −10%(디스크 읽기 3.2배), B′ ±0
- ② 1,000만 행 PK 재구성: 서버가 INPLACE·LOCK=NONE 을 받는다. pt-osc 975.7~977.5초 · binlog +17GB,
  네이티브 5,958.9~5,996.5초 · binlog +0.85GB, 둘 다 쓰기 실패 0 · 최대 공백 1.2~1.35초
- 1차 라운드 팔 N 매판 실패 원인 = 1799(innodb_online_alter_log_max_size 128MiB 초과, 약 2시간 뒤). 2GiB 로 통과
- ③ 세션 조회 차이 없음, id 단건 데움 +0.02~0.07ms
- §5 전제 정정 둘: 08-12 와 행 크기 약 9배 차이(직접 비교 불가), A 의 세션 조회는 uk_pose_event 를 탄다

ㄴ(RC)을 다시 열지는 결정 안 함 — 사용자 confirm 대기.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pk-cost

# Conflicts:
#	docs/decisions/r276-lock-root-cause-fix.md
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant