Hi, I have few questions about the way a transaction group is created. 1. Is it possible to group transactions related to multiple operations in same group? For example, an "rmdir foo" followed by "mkdir bar", can these end up in same transaction group? 2. Is it possible for an operation (say write()) to occupie multiple transaction groups? 3. Is it possible to know the thread id(s) for every commited txg_id? Regards, -Atul
Atul, Atul Vidwansa wrote:> Hi, > I have few questions about the way a transaction group is created. > > 1. Is it possible to group transactions related to multiple operations > in same group? For example, an "rmdir foo" followed by "mkdir bar", > can these end up in same transaction group?Each TXG is 5 sec long (in normal cases unless some operation forcefully closed it). So, it is quite possible that the 2 syscalls can end up in the same TXG. But, is not guaranteed. If it has to be guaranteed then this logic will have to be built into the VNODE ops code. ie. ZPL code. However, that would be tricky as rmdir and mkdir are 2 different syscalls and I am not sure what locking issues you would need to take care.> > 2. Is it possible for an operation (say write()) to occupie multiple > transaction groups?Yes.> > 3. Is it possible to know the thread id(s) for every commited txg_id?The TXG is always synced by the txg threads. Not sure why you want it. Regards, Sanjeev.> > Regards, > -Atul > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss-- Solaris Revenue Products Engineering, India Engineering Center, Sun Microsystems India Pvt Ltd. Tel: x27521 +91 80 669 27521
Mark Maybee
2007-Apr-09 13:43 UTC
[zfs-discuss] Re: [zfs-code] Contents of transaction group?
Atul Vidwansa wrote:> Hi, > I have few questions about the way a transaction group is created. > > 1. Is it possible to group transactions related to multiple operations > in same group? For example, an "rmdir foo" followed by "mkdir bar", > can these end up in same transaction group? >Yes.> 2. Is it possible for an operation (say write()) to occupie multiple > transaction groups? >Yes. Writes are broken into transactions at block boundaries. So it is possible for a large write to span multiple transaction groups.> 3. Is it possible to know the thread id(s) for every commited txg_id? >No. -Mark
Sanjeev, Thanks for the response. The thread_ids I was talking about are userland threads, not the ZFS transaction thread. Is it possible to know for each commited transaction group, which transactions (id) were part of it and which syscall or userland thread initiated those syscalls? Cheers, -Atul On 4/9/07, Sanjeev Bagewadi <Sanjeev.Bagewadi at sun.com> wrote:> Atul, > > Atul Vidwansa wrote: > > Hi, > > I have few questions about the way a transaction group is created. > > > > 1. Is it possible to group transactions related to multiple operations > > in same group? For example, an "rmdir foo" followed by "mkdir bar", > > can these end up in same transaction group? > Each TXG is 5 sec long (in normal cases unless some operation forcefully > closed it). > So, it is quite possible that the 2 syscalls can end up in the same TXG. > But, is not guaranteed. > > If it has to be guaranteed then this logic will have to be built into > the VNODE ops code. ie. ZPL > code. However, that would be tricky as rmdir and mkdir are 2 different > syscalls and I am not sure what locking > issues you would need to take care. > > > > 2. Is it possible for an operation (say write()) to occupie multiple > > transaction groups? > Yes. > > > > 3. Is it possible to know the thread id(s) for every commited txg_id? > The TXG is always synced by the txg threads. Not sure why you want it. > > Regards, > Sanjeev. > > > > > Regards, > > -Atul > > _______________________________________________ > > zfs-discuss mailing list > > zfs-discuss at opensolaris.org > > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss > > > -- > Solaris Revenue Products Engineering, > India Engineering Center, > Sun Microsystems India Pvt Ltd. > Tel: x27521 +91 80 669 27521 > >
On 9-Apr-07, at 8:15 AM, Atul Vidwansa wrote:> Hi, > I have few questions about the way a transaction group is created. > > 1. Is it possible to group transactions related to multiple operations > in same group? For example, an "rmdir foo" followed by "mkdir bar", > can these end up in same transaction group?I began to wonder about doing this with Reiser''s filesystems. It''s certainly an interesting capability to have & I''m looking forward to this thread... --Toby> > 2. Is it possible for an operation (say write()) to occupie multiple > transaction groups? > > 3. Is it possible to know the thread id(s) for every commited txg_id? > > Regards, > -Atul > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Atul Vidwansa wrote:> Hi, > I have few questions about the way a transaction group is created. > > 1. Is it possible to group transactions related to multiple operations > in same group? For example, an "rmdir foo" followed by "mkdir bar", > can these end up in same transaction group? > > 2. Is it possible for an operation (say write()) to occupie multiple > transaction groups? > > 3. Is it possible to know the thread id(s) for every commited txg_id?What problem are you trying to solve here ? Why do you think it would be useful to know after the fact which threads did operations in a given transaction group ? -- Darren J Moffat