All of lore.kernel.org
 help / color / mirror / Atom feed
* sparse file support
@ 2011-01-20 21:11 Brian Chrisman
  2011-01-20 21:28 ` Sage Weil
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Chrisman @ 2011-01-20 21:11 UTC (permalink / raw)
  To: ceph-devel

I've performed some simple testing of sparse files on ceph.  Summary,
ceph reports full file size to 'du' and 'ls', where it should return
actual storage usage to 'du'.  Creating a sparse file on ceph does not
actually use the full file size in storage (which is correct
behavior).  Is this a known issue, or should I submit a bug?

dd if=/dev/urandom of=random.data bs=1024 count=1024
dd if=random.data of=sparse_file.data
dd if=random.data of=sparse_file.data bs=1024k seek=1024
ls -l sparse_file.data
du -sh sparse_file.data

A reference output: ext3
[root@test11 tmp]# ls -l sparse_file.data
-rw-r-r- 1 root root 1074790400 Jan 19 18:43 sparse_file.data
[root@test11 tmp]#
[root@test11 tmp]# du -sh sparse_file.data
2.1M sparse_file.data
[root@test11 tmp]#

Output from: ceph
[root@test11 fs0]# ls -l sparse_file.data
-rw-r-r- 1 root root 1074790400 Jan 19 18:45 sparse_file.data
[root@test11 fs0]# du -sh sparse_file.data
1.1Gsparse_file.data
[root@test11 fs0]#

However, df shows that 1GB of space is not actually used in the filesytem:

[root@test11 fs0]# df -h
Filesystem            Size  Used Avail Use% Mounted on
...
10.200.98.111:/        11T   30M   11T   1% /fs0
[root@test11 fs0]#

-Brian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sparse file support
  2011-01-20 21:11 sparse file support Brian Chrisman
@ 2011-01-20 21:28 ` Sage Weil
  2011-01-20 22:03   ` Brian Chrisman
  2011-01-24  4:28   ` how to do when data size big than osd disk Longguang Yue
  0 siblings, 2 replies; 5+ messages in thread
From: Sage Weil @ 2011-01-20 21:28 UTC (permalink / raw)
  To: Brian Chrisman; +Cc: ceph-devel

On Thu, 20 Jan 2011, Brian Chrisman wrote:
> I've performed some simple testing of sparse files on ceph.  Summary,
> ceph reports full file size to 'du' and 'ls', where it should return
> actual storage usage to 'du'.  Creating a sparse file on ceph does not
> actually use the full file size in storage (which is correct
> behavior).  Is this a known issue, or should I submit a bug?

This is a design choice.  The MDS doesn't know how many blocks are 
allocated because, with the exception of reporting st_blocks to du, it 
doesn't need to.  This makes metadata smaller and the protocols simpler.

sage


> 
> dd if=/dev/urandom of=random.data bs=1024 count=1024
> dd if=random.data of=sparse_file.data
> dd if=random.data of=sparse_file.data bs=1024k seek=1024
> ls -l sparse_file.data
> du -sh sparse_file.data
> 
> A reference output: ext3
> [root@test11 tmp]# ls -l sparse_file.data
> -rw-r-r- 1 root root 1074790400 Jan 19 18:43 sparse_file.data
> [root@test11 tmp]#
> [root@test11 tmp]# du -sh sparse_file.data
> 2.1M sparse_file.data
> [root@test11 tmp]#
> 
> Output from: ceph
> [root@test11 fs0]# ls -l sparse_file.data
> -rw-r-r- 1 root root 1074790400 Jan 19 18:45 sparse_file.data
> [root@test11 fs0]# du -sh sparse_file.data
> 1.1Gsparse_file.data
> [root@test11 fs0]#
> 
> However, df shows that 1GB of space is not actually used in the filesytem:
> 
> [root@test11 fs0]# df -h
> Filesystem            Size  Used Avail Use% Mounted on
> ...
> 10.200.98.111:/        11T   30M   11T   1% /fs0
> [root@test11 fs0]#
> 
> -Brian
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sparse file support
  2011-01-20 21:28 ` Sage Weil
@ 2011-01-20 22:03   ` Brian Chrisman
  2011-01-24  4:28   ` how to do when data size big than osd disk Longguang Yue
  1 sibling, 0 replies; 5+ messages in thread
From: Brian Chrisman @ 2011-01-20 22:03 UTC (permalink / raw)
  To: Sage Weil; +Cc: ceph-devel

On Thu, Jan 20, 2011 at 1:28 PM, Sage Weil <sage@newdream.net> wrote:
> On Thu, 20 Jan 2011, Brian Chrisman wrote:
>> I've performed some simple testing of sparse files on ceph.  Summary,
>> ceph reports full file size to 'du' and 'ls', where it should return
>> actual storage usage to 'du'.  Creating a sparse file on ceph does not
>> actually use the full file size in storage (which is correct
>> behavior).  Is this a known issue, or should I submit a bug?
>
> This is a design choice.  The MDS doesn't know how many blocks are
> allocated because, with the exception of reporting st_blocks to du, it
> doesn't need to.  This makes metadata smaller and the protocols simpler.
>
> sage

Ahh ok, understood.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* how to do when data size big than osd disk.
  2011-01-20 21:28 ` Sage Weil
  2011-01-20 22:03   ` Brian Chrisman
@ 2011-01-24  4:28   ` Longguang Yue
  2011-01-24 17:09     ` Gregory Farnum
  1 sibling, 1 reply; 5+ messages in thread
From: Longguang Yue @ 2011-01-24  4:28 UTC (permalink / raw)
  To: Sage Weil, Brian Chrisman; +Cc: ceph-devel

2 out of 3 is down,so the live osd is full, data lose.
How to solve the case? 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to do when data size big than osd disk.
  2011-01-24  4:28   ` how to do when data size big than osd disk Longguang Yue
@ 2011-01-24 17:09     ` Gregory Farnum
  0 siblings, 0 replies; 5+ messages in thread
From: Gregory Farnum @ 2011-01-24 17:09 UTC (permalink / raw)
  To: Longguang Yue; +Cc: ceph-devel

On Sun, Jan 23, 2011 at 8:28 PM, Longguang Yue
<longguang_yue@tcloudcomputing.com> wrote:
> 2 out of 3 is down,so the live osd is full, data lose.
> How to solve the case?
Well, there's no way to magically make Ceph store more data than the
OSD can hold. However, if you can bring the other OSDs back up you
haven't lost any data.
It's possible that in this scenario the cluster won't recover properly
due to the surviving OSD running out of space, but let's leave dealing
with that until we know it's going to be a problem.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-24 17:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-20 21:11 sparse file support Brian Chrisman
2011-01-20 21:28 ` Sage Weil
2011-01-20 22:03   ` Brian Chrisman
2011-01-24  4:28   ` how to do when data size big than osd disk Longguang Yue
2011-01-24 17:09     ` Gregory Farnum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.