Skip to content
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

Issue65 #66

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Issue65 #66

wants to merge 6 commits into from

Conversation

00pauln00
Copy link
Owner

No description provided.

manishasalve and others added 6 commits April 21, 2021 14:33
Pmdb application while sending the read request can not
predict the actual size of the result.
Added changes in pmdb_obj_get_internal() to allocate buffer
as per the approximate size sent by the client.
But if server returns larger data, raft_client_reply_try_complete()
will reallocate the buffer to be able to accomodate whole result.

The actual reply size should also be sent by to client application
through pmdb_obj_stat_t.
- User can pass NULL pointer to ask pmdb library to allocate
the buffer as per the reply result.
- Or user can pass buffer and pass expand_reply_buff = true to
allow pmdb library to reallocate bigger buffer if reply result
size is larger than application buffer.
- Or user can pass the buffer and if expand_reply_buff = false,
that indicates user don't want to reallocate bigger buffer
if result size is larger than expacted. This can be applicable
if user is very sure abour result size and do not expact result
to be larger than value_size passed.
Added corresponding changes at golang application
to be able to send expand_reply_buff flag.
If expand_reply_buff is true, pmdb library can
allocate/reallocate buffer if user have not passed
any buffer/passed smaller buffer.
Issue #65 appears to be a corner case where a leader of a recently
initialized cluster advances its log index by writing its self-commit to
idx == 0.  However, before the cluster members receive this update, they
elect a new leader.  The original leader then asserts in
raft_server_append_entry_log_prepare_and_check() because
raft_server_append_entry_log_prune_if_needed() did not change the log
header since the raerqm_prev_log_index was < 0.

This patch handles the issue by calling
raft_instance_initialize_newest_entry_hdr() in the raerqm_prev_log_index
< 0 case.
@00pauln00 00pauln00 requested a review from manishasalve May 4, 2021 15:28
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.

2 participants