Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
RedisLabs Raft
Commits
7371bc92
Unverified
Commit
7371bc92
authored
Aug 23, 2022
by
Yehoshua (Josh) Hershberg
Committed by
GitHub
Aug 23, 2022
Browse files
Document entry ownership on log callbacks (#124)
parent
e5d1ceb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/raft.h
View file @
7371bc92
...
@@ -836,6 +836,8 @@ typedef struct raft_log_impl
...
@@ -836,6 +836,8 @@ typedef struct raft_log_impl
/** Remove entries from the start of the log, as necessary when compacting
/** Remove entries from the start of the log, as necessary when compacting
* the log and deleting the oldest entries.
* the log and deleting the oldest entries.
*
*
* The log implementation must call raft_entry_release() on any removed in-memory entries
*
* @param[in] first_idx Index of first entry to be left in log.
* @param[in] first_idx Index of first entry to be left in log.
* @return
* @return
* 0 on success;
* 0 on success;
...
@@ -846,6 +848,8 @@ typedef struct raft_log_impl
...
@@ -846,6 +848,8 @@ typedef struct raft_log_impl
/** Remove entries from the end of the log, as necessary when rolling back
/** Remove entries from the end of the log, as necessary when rolling back
* append operations that have not been committed.
* append operations that have not been committed.
*
*
* The log implementation must call raft_entry_release() on any removed in-memory entries
*
* @param[in] from_idx Index of first entry to be removed. All entries
* @param[in] from_idx Index of first entry to be removed. All entries
* starting from and including this index shall be removed.
* starting from and including this index shall be removed.
* @param[in] cb Optional callback to execute for every removed entry.
* @param[in] cb Optional callback to execute for every removed entry.
...
@@ -857,6 +861,8 @@ typedef struct raft_log_impl
...
@@ -857,6 +861,8 @@ typedef struct raft_log_impl
int
(
*
pop
)
(
void
*
log
,
raft_index_t
from_idx
,
raft_entry_notify_f
cb
,
void
*
cb_arg
);
int
(
*
pop
)
(
void
*
log
,
raft_index_t
from_idx
,
raft_entry_notify_f
cb
,
void
*
cb_arg
);
/** Get a single entry from the log.
/** Get a single entry from the log.
*
* The log implementation must call raft_entry_hold() on the fetched entry
*
*
* @param[in] idx Index of entry to fetch.
* @param[in] idx Index of entry to fetch.
* @return
* @return
...
@@ -870,6 +876,8 @@ typedef struct raft_log_impl
...
@@ -870,6 +876,8 @@ typedef struct raft_log_impl
raft_entry_t
*
(
*
get
)
(
void
*
log
,
raft_index_t
idx
);
raft_entry_t
*
(
*
get
)
(
void
*
log
,
raft_index_t
idx
);
/** Get a batch of entries from the log.
/** Get a batch of entries from the log.
*
* The log implementation must call raft_entry_hold() on the fetched entries
*
*
* @param[in] idx Index of first entry to fetch.
* @param[in] idx Index of first entry to fetch.
* @param[in] entries_n Length of entries (max. entries to fetch).
* @param[in] entries_n Length of entries (max. entries to fetch).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment