Skip to content
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

Guard SoilPagedIndexStore>>#pageAt:put: against overrides #869

Closed
wants to merge 1 commit into from

Conversation

MarcusDenker
Copy link
Contributor

Make sure to never just override an exisiting page in the store.

We change SoilPagedIndexStore>>#pageAt:put: to use #at:ifPresent:ifAbsentPut: to raise an error in this case

We change SoilPagedIndexStore>>#pageAt:put: to use #at:ifPresent:ifAbsentPut: to raise an error in this case
@MarcusDenker
Copy link
Contributor Author

In my image this was green, but it was not the latest version of Soil I think

@MarcusDenker
Copy link
Contributor Author

So, indeed with he newest Soil this guard fails:

SoilBasicSkipList>>#splitPage:forKey:

is adding a page with a key that is already in the store

@MarcusDenker
Copy link
Contributor Author

No, we need to be able to override a free page with a recycled page. Correct check is:

pageAt: anInteger put: aPage 
	
	^ pagesMutex critical: [  
		pages at: anInteger ifPresent: [:page | (page class == SoilFreePage) ifFalse: [ self error ]  ].
		pages 
			at: anInteger 
			put: aPage ] 

and that is green

@MarcusDenker
Copy link
Contributor Author

(I close the Pr)

@MarcusDenker MarcusDenker deleted the Guad-page-adding branch November 28, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant