Skip to content

Conversation

@ahrtr
Copy link
Member

@ahrtr ahrtr commented Jul 9, 2024

A writing TXN should never free a page which was allocated by itself.

Link to #789

@tjungblu
Copy link
Contributor

tjungblu commented Jul 9, 2024

@ahrtr
Copy link
Member Author

ahrtr commented Jul 9, 2024

https://github.com/etcd-io/bbolt/compare/main...tjungblu:cache_freelist_inconsistency?expand=1#diff-3d69c5fb9cdafd3a4e75384354f4a9e14b5318b0e4ec549000cfebd1ac3c6b1bR183-R202

line 194, it tries to free a page which was just allocated by itself. You can do this in a unit test, but actually it will never happen in real production use case.

f.free(common.Txid(2), common.NewPage(allocate, common.LeafPageFlag, 0, 1))

@tjungblu
Copy link
Contributor

tjungblu commented Jul 9, 2024

I'm not saying it's a production issue, I was merely testing all the branches ;-)
If it's not allowed, the panic is the correct way to continue with this.

@tjungblu
Copy link
Contributor

/lgtm

@ahrtr
Copy link
Member Author

ahrtr commented Jul 22, 2024

Just rebased this PR, PTAL @fuweid @tjungblu

@tjungblu
Copy link
Contributor

still looks good!

/lgtm

@ahrtr ahrtr force-pushed the freelist_rollback_20240709 branch from fc5006f to da1c83c Compare July 30, 2024 07:41
@k8s-ci-robot k8s-ci-robot removed the lgtm label Jul 30, 2024
@ahrtr
Copy link
Member Author

ahrtr commented Jul 30, 2024

Just rebased this PR, PTAL @fuweid @tjungblu

@tjungblu
Copy link
Contributor

/lgtm

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, fuweid

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ahrtr ahrtr merged commit df83d9d into etcd-io:main Jul 30, 2024
@ahrtr ahrtr deleted the freelist_rollback_20240709 branch August 12, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants