Repository navigation
fix (RSS): restore StorageOccupancy accounting keys and Meta key in FreeDiskSpaceCommand - #8867
Merged
fstagni merged 2 commits intoNov 2, 2026
Conversation
9152869 removed StorageElement and Endpoint from the accountingDict used to fill the StorageOccupancy accounting registers. These two fields are mandatory key fields of the accounting type (checkValues fails otherwise), so since then no StorageOccupancy record could be committed, with CacheFeederAgent repeatedly logging: Could not commit register Invalid values: no value for Endpoint, no value for StorageElement Fill them again, with a deprecated placeholder endpoint.
b7f5f47 replaced the selectSpaceTokenOccupancyCache client call with a direct rmDB.select, but passed the meta conditions under the key 'meta' (lowercase). SQLAlchemyDB.select only recognizes 'Meta', so 'meta' was treated as a table column and _cleanCommand crashed with: AttributeError: type object 'SpaceTokenOccupancyCache' has no attribute 'meta' making doMaster fail at the end of every cycle (and skipping the cache cleanup).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to 9152869 (
Endpointremoval fromSpaceTokenOccupancyCache), which introduced two regressions inFreeDiskSpaceCommand:checkValues()(BaseAccountingType) requires everydefinitionKeyFieldsentry ofStorageOccupancy(Site,Endpoint,StorageElement,SpaceType) to be set beforegDataStoreClient.addRegister()accepts a record. WithEndpointandStorageElementremoved from the dict, all 3 registers per SE (Total/Free/Used) were rejected, i.e. no StorageOccupancy accounting data has been committed since the v12.0.22 deployment.The DB-side
StaleDataError(UPDATE ... expected to update 1 row(s); 2 were matched) was already resolved operationally by deduplicating rows perTokenand dropping theEndpointcolumn, and is therefore not part of this PR.Evidence
Before (v12.0.22, CacheFeederAgent logs):
After: all
StorageOccupancy.definitionKeyFieldsare filled, socheckValues()passes andaddRegister()accepts the records;_cleanCommandmeta conditions are recognized bySQLAlchemyDB.select(params.get("Meta", {})), sodoMasterno longer crashes at the end of each cycle.ruff/pylinton the touched file report only pre-existing findings. The RSS integration tests require a live CS/MySQL and cannot run in CI-less environments.Note: accounting plots will show a gap covering the v12.0.22 window, since the rejected registers never reached the DataStore.
Merge Danger
Door: two-way
Both commits are small, independent and trivially revertable; no schema or accounting type definition is changed (
Endpoint: "Deprecated"is just a placeholder value, consistent with what the cache table has stored since Aug 2024).Blast Radius: CacheFeederAgent
Only
FreeDiskSpaceCommandis touched. Ramifications if wrong: accounting records with a placeholderEndpoint(cosmetic for plots, which group onStorageElement/SpaceType), or a restored crash in the end-of-cycle cleanup (worst case: same as current production behaviour).