Project

General

Profile

Actions

Bug #13848

closed

Removed objects may stay in cache forever

Added by Igor Fedotov over 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
OSD
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

It seems that Ceph caching doesn't take removed ( whitened out) objects
into accounts when checks for the need to flush the cache.

Following pools have been created:
./ceph -c ceph.conf osd pool create cachepool 12 12
./ceph -c ceph.conf osd pool create ecpool 12 12 erasure
./ceph -c ceph.conf osd tier add ecpool cachepool
./ceph -c ceph.conf osd tier cache-mode cachepool writeback

./ceph -c ceph.conf osd tier set-overlay ecpool cachepool
./ceph -c ceph.conf osd pool set cachepool hit_set_type bloom
./ceph -c ceph.conf osd pool set cachepool target_max_bytes 1000000

Then doing the following in a loop:
- Write 16K data to a new object with unique name
- Remove object.

causes cache pool object count to grow permanently:
ceph/ceph_com/src# ./rados -c ceph.conf df
pool name KB objects clones degraded unfound rd rd KB wr wr KB
cachepool 48 285 0 0 0 0 0 567 4560
...
ceph/ceph_com/src# ./rados -c ceph.conf df
pool name KB objects clones degraded unfound rd rd KB wr wr KB
cachepool 0 5947 0 0 0 0 0 11894 95152
...
etc.

The same applies to disk usage reported by du command:
/ceph/ceph_com/src# du -h dev -s
461M dev
...
/ceph/ceph_com/src# du -h dev -s
465M dev

From code analysis it looks like following two parameters affect cache
flush triggering: target_max_bytes and target_max_objects.
When the latter set to 0 (by default) cache flush wouldn't happen no
matter how many removed objects are in the cache since their size is
supposed to be 0 bytes. But in fact that's not true - empty
files(objects) consume some space too. Thus potentially one can even
completely overfill the cache with removed objects.


Related issues 1 (1 open0 closed)

Related to Ceph - Support #12177: removing cached objects doesn't quickly remove tiered ec objectsNew06/26/2015

Actions
Actions #1

Updated by Igor Fedotov over 8 years ago

Behavior described at
http://tracker.ceph.com/issues/12177

was probably caused by the same root cause.

Actions #2

Updated by Nathan Cutler over 8 years ago

  • Related to Support #12177: removing cached objects doesn't quickly remove tiered ec objects added
Actions #3

Updated by Igor Fedotov over 8 years ago

Simple ( but probably not the best) solution to trigger cache flush can be found at:
https://github.com/ceph/ceph/pull/6664

Actions #4

Updated by Loïc Dachary over 8 years ago

  • Status changed from New to Duplicate
Actions #5

Updated by Loïc Dachary over 8 years ago

  • Status changed from Duplicate to Fix Under Review
Actions #6

Updated by Sage Weil almost 8 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF