-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#159] WAL 로그 저장 포맷 선택 및 구현 #169
Open
wHoIsDReAmer
wants to merge
9
commits into
master
Choose a base branch
from
feat/#159
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a64c9aa
chore: add wal files
wHoIsDReAmer 54ec7fa
feat(WAL): 매니저 추가 & 에러, 타입 정의 & 메서드 타입 틀 추가
wHoIsDReAmer ba1572e
feat: WALBuilder 구현
wHoIsDReAmer 20dd6ed
feat(WALManager): append 작업 정의 & 파일 저장 구현
wHoIsDReAmer 4aef420
chore: WAL 디렉터리 이름, 확장자 추가 & config에 WAL 정보 추가 & WALManager 리팩터링
wHoIsDReAmer 6674a34
fix(initializer): WAL 디렉토리 추가 & 테스트 케이스 알맞게 변경
wHoIsDReAmer 2b6d3a7
feat: 유연함을 위해 encoding / decoding 동작 분리
wHoIsDReAmer 610dfd2
chore: WAL 디렉터리 생성 실패 테스트 추가
wHoIsDReAmer 6ef4303
feat(server): 서버 시작 시 WAL Initializing & process_query에 WALManager 주입
wHoIsDReAmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
use super::RRDBError; | ||
|
||
#[derive(Debug)] | ||
pub struct WALError { | ||
pub message: String, | ||
pub backtrace: std::backtrace::Backtrace, | ||
} | ||
|
||
impl PartialEq for WALError { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.message == other.message | ||
} | ||
} | ||
|
||
impl WALError { | ||
pub fn wrap<T: ToString>(message: T) -> RRDBError { | ||
RRDBError::WALError(Self { | ||
message: message.to_string(), | ||
backtrace: std::backtrace::Backtrace::capture(), | ||
}) | ||
} | ||
} | ||
|
||
impl std::error::Error for WALError {} | ||
|
||
impl std::fmt::Display for WALError { | ||
fn fmt(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
write!(formatter, "wal error: {}", self.message) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn test_wal_error_eq() { | ||
let error1 = WALError::wrap("test"); | ||
let error2 = WALError::wrap("test"); | ||
assert_eq!(error1, error2); | ||
} | ||
|
||
#[test] | ||
fn test_wal_error_display() { | ||
let error = WALError::wrap("test"); | ||
|
||
assert_eq!(error.to_string(), "wal error: test"); | ||
} | ||
|
||
#[test] | ||
fn test_wal_error_wrap() { | ||
let error = WALError::wrap("test"); | ||
assert_eq!(error.to_string(), "wal error: test"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ pub mod parser; | |
pub mod pgwire; | ||
pub mod server; | ||
pub mod utils; | ||
pub mod wal; | ||
|
||
use std::sync::Arc; | ||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: 추후에는 yaml 이든, 자체 포맷 구현이든 포맷 하나 골라서 구조체 형태로 기본값 정의하기