Skip to content

Conversation

@mulkieran
Copy link
Member

@mulkieran mulkieran commented May 22, 2019

This PR's goal is to eliminate all possibility of failure in methods that are used to supply property values on the D-Bus. Currently, the consequence of a failure in obtaining one of these properties is a message with the form:

no total physical size computed for pool with uuid <some UUID>

when most or all of the stratis CLI commands that require interaction with stratisd are run. None of these CLI commands can succeed when this happens. One of these methods supplies its value via a devicemapper ioctl, another by means of a stat call.

The approach taken here is to cache the values used at the time when these methods are necessarily called, which occurs in the corresponding check methods for each module. The reason this seems like a good idea is that the view that the user gets of the stratisd system is consistent with the view that stratisd has of the system.

However, there is currently a defect. The view that stratisd has based on the information it got in the check methods is the last information that could be obtained. Perhaps subsequently, the check method was called, but the result returned was Fail or Error. In that case, the information that is placed on the D-Bus and is cached in the objects, is not just slightly stale as is inevitable w/ a cached value, but potentially totally wrong.

Resolves: #1148.

@mulkieran mulkieran requested review from bgurney-rh and drckeefe May 22, 2019 16:36
@mulkieran mulkieran self-assigned this May 22, 2019
@mulkieran
Copy link
Member Author

Please see #1211 for prior discussion.

@mulkieran
Copy link
Member Author

Ok, thanks. I'm going to examine the problem and see if the total staleness problem can be mitigated. Also, verify that signals are being set where appropriate.

mulkieran added 3 commits June 3, 2019 09:09
Set it on creation and set up.

Use the cached value in ThinPool::total_physical_used.
Change the return type of total_physical_used so that it returns a simple
value, not a Result, since none of the functions that it calls can return
an error. Change the return type of methods that invoke this method,
including Pool::total_physical_used. Change D-Bus layer property method
for pool's total physical size so that it can not return an error.

Cache the value of ThinPool::thin_pool_status field in ThinPool::check(),
which is the only place where the thin pool device's status is checked.

Signed-off-by: mulhern <[email protected]>
Since it uses a cached value, it cannot fail.

Signed-off-by: mulhern <[email protected]>
@mulkieran mulkieran force-pushed the master-cache-thinpool-status-2 branch from 7e47122 to 8c85de5 Compare June 3, 2019 13:10
@mulkieran
Copy link
Member Author

rebased.

@mulkieran
Copy link
Member Author

Closing as probably obsolete.

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.

D-Bus properties that can fail should be eliminated

2 participants