On Mon, Oct 14, 2013 at 10:53 PM, Gaurav Mahajan <[email protected]>wrote:
> Hi Matt, > > Thanks for the reply. > So can it happen like block gets physically allocate in one txg (say > txg=123) using metaslab_alloc() > So the blkptr will have only blk_birth=123 and bkp_phys_birth=0. > > Later on this block gets assigned to a Dnode (lets say ion txg 456) > What do you mean by that? If it was written as part of that dnode then it would be "assigned" in the same txg, 123. Or do you mean the same data is later written to a different file and you have dedup enabled? > then we can modify the blkptr as blk_birth=456 and blk_phys_birth=123. > blkptrs are not modified once they are on disk. > > Would this work? this would work only in case we have dedupe enabled. > If you had dedup enabled, and you write data that is identical to a block that already exists, it will have blk_phys_birth = whenever it was first written, some time in the past; and blk_birth = now, when the new reference is created to the existing physical block. --matt > > Thanks, > Gaurav > > > On Tue, Oct 15, 2013 at 10:59 AM, Matthew Ahrens <[email protected]>wrote: > >> On Wed, Oct 9, 2013 at 3:35 AM, Gaurav Mahajan <[email protected]>wrote: >> >>> Hi, >>> >>> I am new to ZFS and trying to understand the code and workflow. >>> >>> In blkptr structure there are blk_phys_birth and blk_birth are nothing >>> but the txgs. >>> >>> What is the difference between them? >>> How DDT uses these two fields? >>> >>> typedef struct blkptr { >>> .... >>> uint64_t blk_phys_birth; /* txg when block was allocated */ >>> uint64_t blk_birth; /* transaction group at birth */ >>> ..... >>> } blkptr_t; >>> >>> >> blk_birth_phys is when the block was allocated. >> blk_birth is when this particular reference was created. >> >> If the block is dedup'ed, blk_birth_phys can be before blk_birth. (The >> block was allocated at time A, then another reference was added to that >> block at a later time B.) >> >> If they are the same (e.g. as is the case for all non-dedup'ed blocks), >> we only store blk_birth. (I believe this is for backwards compatibility >> with software that doesn't understand dedup (pool version 21)). >> >> blk_birth_phys is used by the SPA, for example when resilvering devices >> that were temporarily offline. >> >> blk_birth is used by the DMU and DSL, for example to determine when to >> free a block, or what blocks should be part of a zfs send stream. >> >> --matt >> >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> > > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. >
_______________________________________________ developer mailing list [email protected] http://lists.open-zfs.org/mailman/listinfo/developer
