arcus-memcached
arcus-memcached copied to clipboard
[persistence] 동적 persistence on/off 기능 필요성 검토
persistence 를 동적으로 on/off 하는 기능의 필요성을 검토하고, 필요 시 개발한다.
동적 on/off 기능의 동작 방법
- command
<config> <persistence> <enable> <config file path>
<config> <persistence> <disable>
config file은 default_engine.conf file을 의미하며, 기본 설정이 모두 있어야 한다.
- persistence disable -> enable
-
config persistence enable file_path
command - engine 내부에서 config file open & parsing & 각 설정의 적절성 확인
- persistence module init & 필요 daemon thread start
- persistence enable
- cache lock
- first snapshot
- persistence config true 설정으로 cache lock 해제 이후 operation 부터 영속성 제공
- unlock cache
- OK 응답
-
- persistence enable -> disable
-
config persistence disable
command - persistence disable
- cache lock
- persistence config false 설정으로 cache lock 해제 이후 operation 부터 영속성 제공하지 않음
- unlock cache
- persistence module destroy & daemon thread stop
- OK 응답
-
@jhpark816 동적 persistence on/off 기능 설계에 대해 위와 같이 정리 해 봤습니다. 검토해 주시면 좋을 것 같습니다.
@jhpark816 @MinWooJin 참고사항입니다. Redis persistence 는 CONFIG SET * 명령어를 통해 동적으로 persistence on/off 가 가능합니다. persistence on/off 뿐만 아니라, rewrite 재수행 조건 (arcus 의 경우 체크포인트 수행 조건) , 명령 로깅 모드 설정, 스냅샷 파일 이름 설정도 동적으로 가능합니다. CONFIG SET appendonly no // 명령 로깅 끄기. CONFIG SET aof-rewrite-min-size 70mb // rewrite 재수행 조건 변경 CONFIG SET dbfilename newname.rdb // 스냅샷 파일 이름 변경 CONFIG SET appendfsync always // 명령 로깅을 동기모드로 변경
이유는 모르겠지만, 명령 로깅 파일의 이름은 동적으로 변경이 불가능합니다.