Skip to content

Expand mutable local blobstore to full capacity#343

Merged
EdSchouten merged 1 commit into
buildbarn:mainfrom
meroton:fix-ac-block-allocation
May 27, 2026
Merged

Expand mutable local blobstore to full capacity#343
EdSchouten merged 1 commit into
buildbarn:mainfrom
meroton:fix-ac-block-allocation

Conversation

@moroten

@moroten moroten commented May 27, 2026

Copy link
Copy Markdown
Contributor

Fix a bug where mutable local blobstore doesn't extend the "current" blocks section to the configured number.

Consider an action cache configuration with old=8, current=24 and new=1. Previous erroneous behaviour would initialize a fresh node with old,current,new=0,0,0 and the steady state would be old,current,new=8,0,1. When restarting the storage where 9 blocks had been persisted, it would be initialized with old,current,new=0,8,1 and get the steady state old,current,new=8,8,1. After a couple of restarts, it would reach full capacity.

Fix a bug where mutable local blobstore doesn't extend the "current"
blocks section to the configured number.

Consider an action cache configuration with old=8, current=24 and new=1.
Previous erroneous behaviour would initialize a fresh node with
old,current,new=0,0,0 and the steady state would be
old,current,new=8,0,1. When restarting the storage where 9 blocks had
been persisted, it would be initialized with old,current,new=0,8,1
and get the steady state old,current,new=8,8,1. After a couple of
restarts, it would reach full capacity.
@moroten

moroten commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

Log for old behaviour:

Reinitializing data store, as persistent state was not found
NewOldCurrentNewLocationBlobMap old=0 current=0 new=0 (cas)
Reinitializing data store, as persistent state was not found
NewOldCurrentNewLocationBlobMap old=0 current=0 new=0 (ac)
findBlockWithSpace old=1 current=0 new=1
findBlockWithSpace old=2 current=0 new=1
findBlockWithSpace old=3 current=0 new=1
findBlockWithSpace old=4 current=0 new=1
Received "terminated" signal. Initiating graceful shutdown.
exited with code 1
NewOldCurrentNewLocationBlobMap old=0 current=0 new=27 (cas)
NewOldCurrentNewLocationBlobMap old=0 current=4 new=1 (ac)
findBlockWithSpace old=1 current=4 new=1
findBlockWithSpace old=2 current=4 new=1
findBlockWithSpace old=3 current=4 new=1
findBlockWithSpace old=4 current=4 new=1
findBlockWithSpace old=5 current=4 new=1
findBlockWithSpace old=6 current=4 new=1
findBlockWithSpace old=7 current=4 new=1
findBlockWithSpace old=8 current=4 new=1
findBlockWithSpace old=8 current=4 new=1
findBlockWithSpace old=8 current=4 new=1
findBlockWithSpace old=8 current=4 new=1
findBlockWithSpace old=8 current=4 new=1
Received "terminated" signal. Initiating graceful shutdown.
exited with code 1
NewOldCurrentNewLocationBlobMap old=0 current=0 new=27 (cas)
NewOldCurrentNewLocationBlobMap old=0 current=12 new=1 (ac)
findBlockWithSpace old=1 current=12 new=1
findBlockWithSpace old=2 current=12 new=1
findBlockWithSpace old=3 current=12 new=1
findBlockWithSpace old=4 current=12 new=1
findBlockWithSpace old=5 current=12 new=1
findBlockWithSpace old=6 current=12 new=1
findBlockWithSpace old=7 current=12 new=1
findBlockWithSpace old=8 current=12 new=1
findBlockWithSpace old=8 current=12 new=1
findBlockWithSpace old=8 current=12 new=1
findBlockWithSpace old=8 current=12 new=1
findBlockWithSpace old=8 current=12 new=1
Received "terminated" signal. Initiating graceful shutdown.
exited with code 1

Log for new behaviour:

Reinitializing data store, as persistent state was not found
NewOldCurrentNewLocationBlobMap old=0 current=0 new=0 (cas)
Reinitializing data store, as persistent state was not found
NewOldCurrentNewLocationBlobMap old=0 current=0 new=0 (ac)
findBlockWithSpace old=0 current=1 new=1
findBlockWithSpace old=0 current=2 new=1
findBlockWithSpace old=0 current=3 new=1
findBlockWithSpace old=0 current=4 new=1
findBlockWithSpace old=0 current=5 new=1
findBlockWithSpace old=0 current=6 new=1
findBlockWithSpace old=0 current=7 new=1
findBlockWithSpace old=0 current=8 new=1
findBlockWithSpace old=0 current=9 new=1
findBlockWithSpace old=0 current=10 new=1
Received "terminated" signal. Initiating graceful shutdown.
exited with code 1
NewOldCurrentNewLocationBlobMap old=0 current=0 new=27 (cas)
NewOldCurrentNewLocationBlobMap old=0 current=10 new=1 (ac)
findBlockWithSpace old=0 current=11 new=1
findBlockWithSpace old=0 current=12 new=1
findBlockWithSpace old=0 current=13 new=1
findBlockWithSpace old=0 current=14 new=1
findBlockWithSpace old=0 current=15 new=1
findBlockWithSpace old=0 current=16 new=1
findBlockWithSpace old=0 current=17 new=1
findBlockWithSpace old=0 current=18 new=1
findBlockWithSpace old=0 current=19 new=1
findBlockWithSpace old=0 current=20 new=1
findBlockWithSpace old=0 current=21 new=1
findBlockWithSpace old=0 current=22 new=1
findBlockWithSpace old=0 current=23 new=1
findBlockWithSpace old=0 current=24 new=1
findBlockWithSpace old=1 current=24 new=1
findBlockWithSpace old=2 current=24 new=1
findBlockWithSpace old=3 current=24 new=1
findBlockWithSpace old=4 current=24 new=1
findBlockWithSpace old=5 current=24 new=1
findBlockWithSpace old=6 current=24 new=1
findBlockWithSpace old=7 current=24 new=1
findBlockWithSpace old=8 current=24 new=1
findBlockWithSpace old=8 current=24 new=1
findBlockWithSpace old=8 current=24 new=1
findBlockWithSpace old=8 current=24 new=1
Received "terminated" signal. Initiating graceful shutdown.
exited with code 1
NewOldCurrentNewLocationBlobMap old=0 current=0 new=27 (cas)
NewOldCurrentNewLocationBlobMap old=8 current=24 new=1 (ac)
findBlockWithSpace old=8 current=24 new=1
findBlockWithSpace old=8 current=24 new=1
findBlockWithSpace old=8 current=24 new=1

@EdSchouten

Copy link
Copy Markdown
Member

Great find! I guess this is caused by the addition of BlockListGrowthPolicy. In the past LocalBlobAccess would always just extend the number of "new" blocks in the loop above. But for the AC/... this is not allowed, as it would prevent overwrites from being reliable.

@EdSchouten EdSchouten merged commit e5a591d into buildbarn:main May 27, 2026
3 checks passed
@EdSchouten

Copy link
Copy Markdown
Member

Thanks!

@moroten moroten deleted the fix-ac-block-allocation branch June 4, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants