Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 2.6] [#9162] PITR: Fix stack overflow in filtering iterator
Summary: Filtering iterator could make a call to Next/Prev while checking filter. But those methods also would check filter. So, iterating over one skipped entry results in adding two more stack frames, one for Next() or Prev() and one more for ApplyFilter(), and the stack grows proportionally to the number of skipped entries, resulting in a potential stack overflow. Actually we should call Next/Prev of the underlying iterator in this case, as done in this diff. This approach would only utilize a constant amount of space on the stack and not linear space based on the number of skipped entries. Original commit: 124af42/D12143 Test Plan: ybd debug --gtest_filter BackupTxnTest.PointInTimeBigSkipRestore Jenkins: rebase: 2.6 Reviewers: bogdan, mbautin Reviewed By: mbautin Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D12153
- Loading branch information