WT-17187 Harden follower-mode fast-truncate truncate list#13562
WT-17187 Harden follower-mode fast-truncate truncate list#13562
Conversation
|
Thanks for creating a pull request! Please answer the questions below by editing this comment — completing this upfront typically speeds up the review process. Checklist before requesting a review
What makes this change safe?Help reviewers focus their attention by answering these questions:
Type of change made in this PR
References: |
| if (start_key->size != 0) { | ||
| WT_RET(__wt_compare(session, collator, key, start_key, &compare_result)); | ||
| if (compare_result < 0) | ||
| return (0); |
There was a problem hiding this comment.
I rather us have is_within_range be set before each return. IMO It's easier to reason about here.
| WT_ERR(__wt_txn_truncate(session, t)); | ||
| WT_ERR(__wt_session_release_dhandle(session)); | ||
| truncate_ret = __wt_txn_truncate(session, t); | ||
| WT_TRET(__wt_session_release_dhandle(session)); |
There was a problem hiding this comment.
We can place the __wt_session_release_dhandle under err: so that we eliminate the need for truncate_ret here. I believe __wt_session_release_dhandle no-ops if there is no dhandle with it (please double-check)
|
|
||
| WT_RET(ret); | ||
|
|
||
| if (is_within_range) { |
| ret = __key_within_truncate_range( | ||
| session, collator, &entry->start_key, &entry->stop_key, key, &is_within_range); | ||
|
|
||
| if ((ret != 0) || is_within_range) |
There was a problem hiding this comment.
how about let's add an err: label. And directly do WT_ERR(__key_within_truncate_range()) here.
|
Test coverage is very low, please refer to the Code change/coverage report links below and try to improve it if feasible.
|
This change aims to fix the bugs identified in WT-17187.