-
Notifications
You must be signed in to change notification settings - Fork 380
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
WT-10807 Skip in-memory deleted pages as part of the tree walk (6.0 backport) #10588
Conversation
Traversing an in-memory page that contains all the deleted values that are visible to the current transaction, leading to an increase in latency due to the time spent skipping these deleted values. By saving the aggregated timestamp information in the ref when the page has all deleted values, this aggregated information can be validated against the transaction snapshot to skip traversing the page completely and improve the latency when there are many deleted pages. The downside of this approach is that the in-memory size of each ref is increased by 8 more bytes, but this increase shouldn't cause any problem. (cherry picked from commit d121cca) (cherry picked from commit eed05eb)
f35344a
to
ad31471
Compare
* could potentially skip pages. The skip function looks at the aggregated timestamp | ||
* information to determine if something is visible on the page. If nothing is, the page is | ||
* skipped. | ||
* If we are running with snapshot isolation, have a snapshot, and are not interested in |
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.
Looks like this comment was missed on 7.0
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.
It is the only change required in 6.0 due to the checkpoint cursors that are not supported, but there exists so many tests that test checkpoint cursors.
*/ | ||
if (!F_ISSET(&cbt->iface, WT_CURSTD_KEY_ONLY) && | ||
session->txn->isolation == WT_ISO_SNAPSHOT && | ||
F_ISSET(session->txn, WT_TXN_HAS_SNAPSHOT) && |
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.
Looks like this was missed on 7.0
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.
It is the only change required in 6.0 due to the checkpoint cursors that are not supported, but there exists so many tests that test checkpoint cursors.
__wt_ref_addr_copy(session, ref, &addr) && addr.ta.newest_stop_txn != WT_TXN_MAX && | ||
addr.ta.newest_stop_ts != WT_TS_MAX && | ||
|
||
if (previous_state == WT_REF_MEM && !__wt_page_is_modified(ref->page)) |
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.
There was this more in 7.0 when the ref is deleted:
walk_skip_stats->total_del_pages_skipped++;
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.
Yes, those code changes are due to the fast truncate data format changes. As those conditions are not possible in 6.0, we do not need it.
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.
Thank you for addressing my different concerns regarding the differences with the 7.0 backport. LGTM!
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.
This looks like a challenging backport, so I've reviewed it super carefully. It looks good - nice work!
Traversing an in-memory page that contains all the deleted values that are visible to the current transaction, leading to an increase in latency due
to the time spent skipping these deleted values.
By saving the aggregated timestamp information in the ref when the page has all deleted values, this aggregated information can be validated against the transaction snapshot to skip traversing the page completely and improve the latency when there are many deleted pages.
The downside of this approach is that the in-memory size of each ref is increased by 8 more bytes, but this increase shouldn't cause any problem.
(cherry picked from commit d121cca) (cherry picked from commit eed05eb)