-
Notifications
You must be signed in to change notification settings - Fork 285
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
Initial offline write support #1801
Conversation
2a1fa88
to
18f4442
Compare
436679d
to
d4f6b22
Compare
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.
left some feedback but overall LGTM
async fn push_with_retry(&self, uri: String, auth_token: &Option<String>, frame: Vec<u8>, max_retries: usize) -> Result<()> { | ||
let mut nr_retries = 0; | ||
loop { | ||
let client = reqwest::Client::new(); |
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.
Whats the reason for using reqwest instead of just hyper directly? We also probably want to cache this client so we can re-use its dns resolution/tls handshake.
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.
No other reason than it was easier to get TLS going with reqwest. I don't mind someone rewriting it to use Hyper after this lands in main
.
pub sync_url: String, | ||
pub auth_token: Option<String>, | ||
pub max_retries: usize, | ||
pub durable_frame_num: u32, |
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.
We should provide getters for these rather than expose them. I can do this in a follow up.
This patch add initial support for offline writes. To open a local database that can sync to remote server, use the Builder::new_synced_database() API. The protocol on server side is simple: **POST** `/sync/<generation>/<start_frame>/<end_frame>` where request body is the WAL frames.
This pull request adds a new type of database, synced database, which
allows local writes that can sync to a remote server.
The protocol on server side is simple:
POST
/sync/<generation>/<start_frame>/<end_frame>
where request body is the WAL frames.