Fix cursor automatically moving to next position when delete and put are in the same TXN by ahrtr · Pull Request #611 · etcd-io/bbolt
…tem from a node Refer to boltdb/bolt#357 Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
ahrtr
mentioned this pull request
ahrtr
marked this pull request as draft
jsternberg added a commit to jsternberg/buildkit that referenced this pull request
Jan 30, 2025The `emptyBranchWithParents` method could accidentally leave link entries that shouldn't exist. When finding these links, deleting during the iteration can sometimes cause the cursor to jump entries that should be deleted. This changes the code path to delete the links outside of the iteration to avoid this. This is caused by a long-standing bug in bolt that can't be fixed easily. See etcd-io/bbolt#611 for details. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
jsternberg added a commit to jsternberg/buildkit that referenced this pull request
Jan 30, 2025The `emptyBranchWithParents` method could accidentally leave link entries that shouldn't exist. When finding these links, deleting during the iteration can sometimes cause the cursor to jump entries that should be deleted. This changes the code path to delete the links outside of the iteration to avoid this. This is caused by a long-standing bug in bolt that can't be fixed easily. See etcd-io/bbolt#611 for details. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
otoolep added a commit to rqlite/rqlite that referenced this pull request
Sep 9, 2025Collect and delete keys that are less than or equal to the requested index. Removing key/values pairs in a bucket during iteration on the bucket using cursor may not work properly. Each time when removing a key/value pair, the cursor may automatically move to the next position if present. When users call c.Next() after removing a key, it may skip one key/value pair. Refer to etcd-io/bbolt#611 for more detailed info.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters