Skip to content

로컬 PostgreSQL 17 및 pgvector 0.8.1 환경으로 전환 - #98

Merged
Gimini-3 merged 6 commits into
developfrom
feature/97
Aug 5, 2026
Merged

로컬 PostgreSQL 17 및 pgvector 0.8.1 환경으로 전환#98
Gimini-3 merged 6 commits into
developfrom
feature/97

Conversation

@Gimini-3

@Gimini-3 Gimini-3 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

변경 내용

  • 로컬 DB 이미지를 pgvector/pgvector:0.8.1-pg17로 전환했습니다.
  • PostgreSQL 17 전용 신규 볼륨과 pgvector 초기화 절차를 구성했습니다.
  • 로컬·테스트 DB 연결 기본값과 Claim Benchmark 환경 검증 기준을 PostgreSQL 17에 맞췄습니다.
  • 로컬 실행, 데이터 보존, 복구 및 Rocky Linux 9.7 OpenSQL 원격 검증 절차를 문서화했습니다.
  • 공급사 설치 파일을 안전하게 격리하도록 .local-vendor/를 Git 추적 대상에서 제외했습니다.

변경 이유

공식 OpenSQL은 Rocky Linux 9.7 x86-64 Single 환경에서만 설치·검증할 수 있으므로, macOS 로컬 개발에서는 PostgreSQL 17 + pgvector를 사용하고 공식 OpenSQL 호환성은 별도의 원격 환경에서 확인하도록 경계를 분리합니다.

개발자 영향

  • 로컬 접속: localhost:55432
  • Database/User: app / app
  • 로컬 DB_SSLMODE=disable
  • 신규 볼륨: docgrid_postgres17_data
  • 기존 opensql_data 볼륨은 자동 이전하거나 삭제하지 않습니다.
  • docker compose down -v는 다른 서비스 볼륨까지 삭제할 수 있으므로 사용하지 않습니다.

검증

  • PostgreSQL 17.8 / pgvector 0.8.1 기동 확인
  • Flyway 37개 Migration 적용 및 Hibernate Schema Validation 확인
  • vector(1024) 컬럼과 HNSW cosine index 확인
  • 전체 테스트 및 Claim 동시성 테스트 성공
  • 축소 Claim Benchmark 성공
  • Gradle Build 성공
  • 기존 opensql_data 볼륨 보존 확인

Closes #97

Summary by CodeRabbit

  • 개선 사항

    • 로컬 데이터베이스가 PostgreSQL 17 및 pgvector 0.8.1 기반으로 업그레이드되었습니다.
    • ARM64 및 x86-64 환경에서 Docker Compose로 간편하게 실행할 수 있습니다.
    • PostgreSQL 17 전용 데이터 볼륨을 사용해 기존 데이터와 분리됩니다.
    • 로컬·테스트 환경의 기본 SSL 설정이 비활성화되었습니다.
    • vector 확장이 자동으로 초기화되어 벡터 검색 기능을 바로 사용할 수 있습니다.
  • 문서

    • 로컬 DB 설치, 실행, 검증, 문제 해결 및 롤백 절차가 추가되었습니다.
    • PostgreSQL 17 전환 검증 결과와 운영 시 주의사항이 문서화되었습니다.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

로컬 DB 실행 기준이 PostgreSQL 17과 pgvector 0.8.1로 전환되었습니다. Compose, 초기화 SQL, Local/Test 연결 기본값, Benchmark 환경 검증이 갱신되었습니다. 실행 문서, 설계 문서, 검증 결과도 함께 추가되었습니다.

Changes

로컬 PostgreSQL 17 환경 전환

Layer / File(s) Summary
컨테이너와 초기화 경로 갱신
docker-compose.yml, docker/postgres/init/001-enable-vector.sql, README.md, .env.example, docs/design/...#97-postgresql17-pgvector-local-environment.md
로컬 PostgreSQL 서비스가 pgvector/pgvector:0.8.1-pg17 기반으로 바뀌었습니다. 새 docgrid_postgres17_data 볼륨과 init SQL로 vector 확장을 준비합니다. 실행 안내와 환경 예시도 PostgreSQL 17 기준으로 갱신되었습니다.
연결 설정과 Benchmark 가드 정렬
src/main/resources/application-local.yml, src/main/resources/application-test.yml, src/test/java/.../EmbeddingJobClaimPerformanceBenchmark.java, docs/design/...#97-postgresql17-pgvector-local-environment.md
Local/Test 기본 sslmodedisable로 바뀌었습니다. Benchmark는 PostgreSQL 17.과 pgvector 0.8.1을 기대값으로 검증합니다. 관련 설계 문서도 같은 연결 계약과 검증 조건을 명시합니다.
운영 문서와 검증 기록 추가
docs/local-db.md, docs/test-results/...#97-postgresql17-pgvector-local-environment.md, docs/design/...#97-postgresql17-pgvector-local-environment.md, .gitignore
로컬 DB Runbook이 추가되었습니다. PostgreSQL 17 기동, 확장·스키마 검증, 테스트, 롤백, 원격 OpenSQL 검증 절차를 문서화했습니다. 실행 결과 문서는 로컬 검증, 테스트 복구, Claim 경쟁 테스트, Benchmark Smoke 결과를 기록합니다. /local-vendor/ 무시 규칙도 추가되었습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • DocGrid/backend#38: 둘 다 PostgreSQL/pgvector Docker 구성을 다룹니다. 이번 PR은 기존 OpenSQL PostgreSQL 14 커스텀 구성을 PostgreSQL 17 기반 Compose 구성으로 교체합니다.
  • DocGrid/backend#4: 둘 다 로컬 PostgreSQL 설정 파일을 수정합니다. 이번 PR은 PR #4에서 도입된 로컬 DB 경로를 PostgreSQL 17 기준으로 재구성합니다.

Suggested labels: ✨ Feature

Suggested reviewers: kangcheolung

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning 대부분의 #97 요구사항을 구현했지만 공급사 파일 제외 경로가 설명의 .local-vendor/와 실제 .gitignore/local-vendor/로 불일치합니다. 공급사 파일의 실제 경로와 .gitignore 규칙을 동일하게 맞추고, 해당 경로가 Git 추적 및 Docker Build Context에서 제외되는지 확인하십시오.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 PostgreSQL 17 및 pgvector 0.8.1 기반 로컬 환경 전환이라는 PR의 핵심 변경을 정확히 요약합니다.
Description check ✅ Passed 변경 내용, 이유, 영향, 검증 결과와 이슈 연결을 구체적으로 설명하며 템플릿의 핵심 정보를 대부분 포함합니다.
Out of Scope Changes check ✅ Passed 변경 사항은 PostgreSQL 17 및 pgvector 0.8.1 로컬 환경 전환, 검증, 문서화 범위에 포함됩니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/97

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

Comment @coderabbitai help to get the list of available commands.

@Gimini-3
Gimini-3 merged commit 7b954f8 into develop Aug 5, 2026
1 check was pending

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/design/Gimini-3-`#97-postgresql17-pgvector-local-environment.md:
- Line 164: Update the prohibited-string search command so finding any
deprecated configuration causes failure: negate the rg result or wrap it in an
explicit conditional that exits with status 1 when matches are found, while
preserving the existing search patterns and paths.

In `@docs/local-db.md`:
- Line 212: Update the 상세 설계 Markdown link so the `#` in the referenced filename
is URL-encoded as `%23`, preserving the complete
`Gimini-3-#97-postgresql17-pgvector-local-environment.md` filename in the
target.

In `@docs/test-results/Gimini-3-`#97-postgresql17-pgvector-local-environment.md:
- Around line 1-20: 문서의 검증 결과에 Swagger 수동 테스트 결과를 추가하고, Gradle 자동 테스트 결과와 함께 성공
여부 및 확인 내용을 기록하세요. Swagger 검증이 적용되지 않는 경우에는 그 사유를 명시하고 관련 예외 기준을 확인하세요. 파일명은
docs/test-results의 {github아이디}-#{이슈번호}-{설명}.md 규칙을 따르도록 점검하고 필요하면 수정하세요.

In `@README.md`:
- Around line 10-13: README의 PostgreSQL 시작 절차에서 docker compose ps 다음에 postgres
서비스가 healthy가 될 때까지 명시적으로 대기하는 단계를 추가하세요. healthy 상태 확인이 완료된 후에만 ./gradlew
bootRun이 실행되도록 순서를 명확히 하고, 기존 compose 명령은 필요한 범위에서 유지하세요.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4201b432-916c-4876-a00b-abc46c0af387

📥 Commits

Reviewing files that changed from the base of the PR and between 08bd034 and 2b81a98.

📒 Files selected for processing (14)
  • .env.example
  • .gitignore
  • README.md
  • docker-compose.yml
  • docker/opensql/Dockerfile
  • docker/opensql/init-and-start.sh
  • docker/opensql/vars.yml
  • docker/postgres/init/001-enable-vector.sql
  • docs/design/Gimini-3-#97-postgresql17-pgvector-local-environment.md
  • docs/local-db.md
  • docs/test-results/Gimini-3-#97-postgresql17-pgvector-local-environment.md
  • src/main/resources/application-local.yml
  • src/main/resources/application-test.yml
  • src/test/java/com/opensource/docgrid/domain/embedding/benchmark/EmbeddingJobClaimPerformanceBenchmark.java
💤 Files with no reviewable changes (3)
  • docker/opensql/init-and-start.sh
  • docker/opensql/Dockerfile
  • docker/opensql/vars.yml

~~~bash
docker compose config
git status --short --ignored
rg '14\.6|pgsql-14|opensql_data|linux/amd64' docker-compose.yml docker README.md src/main src/test

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

금지 문자열 검색을 실패 조건으로 만드세요.

rg는 금지 문자열을 찾으면 종료 코드 0을 반환합니다. 현재 명령은 오래된 설정이 남아 있어도 성공으로 처리될 수 있습니다. ! rg ... 또는 명시적인 if rg ...; then exit 1; fi 조건을 사용하세요.

권장 수정
-rg '14\.6|pgsql-14|opensql_data|linux/amd64' docker-compose.yml docker README.md src/main src/test
+! rg '14\.6|pgsql-14|opensql_data|linux/amd64' docker-compose.yml docker README.md src/main src/test
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rg '14\.6|pgsql-14|opensql_data|linux/amd64' docker-compose.yml docker README.md src/main src/test
! rg '14\.6|pgsql-14|opensql_data|linux/amd64' docker-compose.yml docker README.md src/main src/test
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/design/Gimini-3-`#97-postgresql17-pgvector-local-environment.md at line
164, Update the prohibited-string search command so finding any deprecated
configuration causes failure: negate the rg result or wrap it in an explicit
conditional that exits with status 1 when matches are found, while preserving
the existing search patterns and paths.

Comment thread docs/local-db.md

## 11. 관련 문서

- [상세 설계](design/Gimini-3-#97-postgresql17-pgvector-local-environment.md)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

#97이 포함된 파일 링크를 URL-인코딩하세요.

Markdown URL에서 #는 fragment 시작 문자입니다. 현재 링크는 파일명 전체가 아니라 Gimini-3- 경로와 fragment로 해석될 수 있습니다. 파일명 규칙을 유지하려면 %23을 사용하세요.

권장 수정
-- [상세 설계](design/Gimini-3-#97-postgresql17-pgvector-local-environment.md)
+- [상세 설계](design/Gimini-3-%2397-postgresql17-pgvector-local-environment.md)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- [상세 설계](design/Gimini-3-#97-postgresql17-pgvector-local-environment.md)
- [상세 설계](design/Gimini-3-%2397-postgresql17-pgvector-local-environment.md)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/local-db.md` at line 212, Update the 상세 설계 Markdown link so the `#` in
the referenced filename is URL-encoded as `%23`, preserving the complete
`Gimini-3-#97-postgresql17-pgvector-local-environment.md` filename in the
target.

Comment on lines +1 to +20
# #97 PostgreSQL 17 및 pgvector 0.8.1 로컬 실행 환경 검증 결과

## 1. 검증 개요

- 실행 일자: 2026-08-05
- Branch: `feature/97`
- 검증 기준 Commit: `e6f6ef3bf967600129c32b871e426bf272e707a0`
- Host OS: macOS 26.5.2
- Host Architecture: arm64
- CPU: Apple M5, 10 Core
- Docker Engine: 29.4.1
- Container Image: `pgvector/pgvector:0.8.1-pg17`
- Container Image Architecture: `linux/arm64`
- Database: PostgreSQL 17.8
- Vector Extension: pgvector 0.8.1
- Database SSL: 비활성화

공급사 설치 Archive, 다운로드 정보와 라이선스는 검증에 사용하지 않았고 Repository 및 Docker
Build Context에도 포함하지 않았다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Swagger 수동 검증 결과를 포함하세요.

현재 문서는 Docker/SQL 확인과 Gradle 자동 테스트 결과를 기록합니다. Swagger 수동 테스트 결과는 없습니다. DB 전환에 Swagger 검증이 적용되지 않는다면 그 사유를 명시하고 문서 위치의 예외를 확인하세요. 적용된다면 수동 결과를 자동 테스트 결과와 함께 기록하세요.

As per path instructions, docs/test-results/*.md: Test result documents must use the {github아이디}-#{이슈번호}-{설명}.md naming convention and combine Swagger manual-test results with automated-test results.

Also applies to: 114-150

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/test-results/Gimini-3-`#97-postgresql17-pgvector-local-environment.md
around lines 1 - 20, 문서의 검증 결과에 Swagger 수동 테스트 결과를 추가하고, Gradle 자동 테스트 결과와 함께 성공
여부 및 확인 내용을 기록하세요. Swagger 검증이 적용되지 않는 경우에는 그 사유를 명시하고 관련 예외 기준을 확인하세요. 파일명은
docs/test-results의 {github아이디}-#{이슈번호}-{설명}.md 규칙을 따르도록 점검하고 필요하면 수정하세요.

Source: Path instructions

Comment thread README.md
Comment on lines +10 to 13
docker compose pull postgres
docker compose up -d postgres
docker compose ps
./gradlew bootRun --args='--spring.profiles.active=local'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

PostgreSQL healthy 상태를 확인한 뒤 Spring Boot를 시작하세요.

docker compose up -d postgres는 healthcheck 완료를 기다리지 않습니다. 현재 docker compose ps는 상태를 표시할 뿐 다음 명령을 차단하지 않습니다. 새 volume 초기화 중에 bootRun이 시작되면 연결 또는 Flyway가 실패할 수 있습니다. 명시적인 healthy 대기를 추가하거나 수동 확인 절차를 분리하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 10 - 13, README의 PostgreSQL 시작 절차에서 docker compose ps
다음에 postgres 서비스가 healthy가 될 때까지 명시적으로 대기하는 단계를 추가하세요. healthy 상태 확인이 완료된 후에만
./gradlew bootRun이 실행되도록 순서를 명확히 하고, 기존 compose 명령은 필요한 범위에서 유지하세요.

Gimini-3 added a commit that referenced this pull request Aug 5, 2026
PR #98 리뷰 후속 문서 및 DB 기동 절차 보완
@Gimini-3 Gimini-3 self-assigned this Aug 5, 2026
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.

[Feat] PostgreSQL 17 및 pgvector 0.8.1 로컬 실행 환경 지원 추가 구현

1 participant