MCPcopy Index your code
hub / github.com/containerd/containerd / MarkFaulty

Method MarkFaulty

plugins/snapshots/devmapper/metadata.go:139–158  ·  view source on GitHub ↗

MarkFaulty marks the given device and corresponding devmapper device ID as faulty. The snapshotter might attempt to recreate a device in 'Faulty' state with another devmapper ID in subsequent calls, and in case of success its status will be changed to 'Created' or 'Activated'. The devmapper dev ID w

(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

137// subsequent calls, and in case of success its status will be changed to 'Created' or 'Activated'.
138// The devmapper dev ID will remain in 'deviceFaulty' state until manually handled by a user.
139func (m *PoolMetadata) MarkFaulty(ctx context.Context, name string) error {
140 return m.db.Update(func(tx *bolt.Tx) error {
141 var (
142 device = DeviceInfo{}
143 devBucket = tx.Bucket(devicesBucketName)
144 )
145
146 if err := getObject(devBucket, name, &device); err != nil {
147 return err
148 }
149
150 device.State = Faulty
151
152 if err := putObject(devBucket, name, &device, true); err != nil {
153 return err
154 }
155
156 return markDeviceID(tx, device.DeviceID, deviceFaulty)
157 })
158}
159
160// getNextDeviceID finds the next free device ID by taking a cursor
161// through the deviceIDBucketName bucket and finding the next sequentially

Callers 5

ensureDeviceStatesMethod · 0.80
CreateThinDeviceMethod · 0.80
rollbackActivateMethod · 0.80
CreateSnapshotDeviceMethod · 0.80

Calls 4

getObjectFunction · 0.85
putObjectFunction · 0.85
markDeviceIDFunction · 0.85
UpdateMethod · 0.65

Tested by 1