MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / scanCacheWritebackFailures

Method scanCacheWritebackFailures

cmd/disk-cache-backend.go:1229–1259  ·  view source on GitHub ↗

queues writeback upload failures on server startup

(ctx context.Context)

Source from the content-addressed store, hash-verified

1227
1228// queues writeback upload failures on server startup
1229func (c *diskCache) scanCacheWritebackFailures(ctx context.Context) {
1230 defer close(c.retryWritebackCh)
1231 filterFn := func(name string, typ os.FileMode) error {
1232 if name == minioMetaBucket {
1233 // Proceed to next file.
1234 return nil
1235 }
1236 cacheDir := pathJoin(c.dir, name)
1237 meta, _, _, err := c.statCachedMeta(ctx, cacheDir)
1238 if err != nil {
1239 return nil
1240 }
1241
1242 objInfo := meta.ToObjectInfo()
1243 status, ok := objInfo.UserDefined[writeBackStatusHeader]
1244 if !ok || status == CommitComplete.String() {
1245 return nil
1246 }
1247 select {
1248 case c.retryWritebackCh <- objInfo:
1249 default:
1250 }
1251
1252 return nil
1253 }
1254
1255 if err := readDirFn(c.dir, filterFn); err != nil {
1256 logger.LogIf(ctx, err)
1257 return
1258 }
1259}
1260
1261// NewMultipartUpload caches multipart uploads when writethrough is MINIO_CACHE_COMMIT mode
1262// multiparts are saved in .minio.sys/multipart/cachePath/uploadID dir until finalized. Then the individual parts

Callers 1

newDiskCacheFunction · 0.95

Calls 6

statCachedMetaMethod · 0.95
LogIfFunction · 0.92
pathJoinFunction · 0.85
readDirFnFunction · 0.70
StringMethod · 0.65
ToObjectInfoMethod · 0.45

Tested by

no test coverage detected