Richard Elling wrote:

On Wed, 2006-05-03 at 11:10 -0700, eric kustarz wrote:
2) structured or un-structured log information?  there are at least two
fields now, and potentially more later (if you add the hostname,
username, etc.).  If it's unstructured, why?  if it's structured, how do
I get at individual fields of each record?

Its really just a simple plain text file of strings of the following entries:

<string type><string value><delimiter>

The delimiter is the '\0' character. So right now we record time (string type 't') and command (string type 'c').

That will look like:
<'\0'><'t'><time encoded as string><'\0'><'c'><"zfs pool create hewitt c1t1d0s3"><'\0'>

The extra NULL character preceding the time string is done so i can always find the beginning of a "record" (where a record contains several entries). This is important since its a ring buffer and data is overwritten (though the 'zpool create' never is).

So to find individual fields (entries) you need to parse through the strings.

In the future we will have something like:
<'\0'><'t'><time string><'\0'><'c'><"zfs pool create hewitt c1t1d0s3"><'\0'><'h'><"super_server"><'\0'><'u'><"ek110237"><'\0'>

Why not use a terse XML format?  It could be extended later as needed
without affecting tools and can easily accomodate the argv[] array.

I didn't see a need for it. Do you have a specific example where it works but what i proposed doesn't?

For that matter, shouldn't it just be in a hidden file (.zfs-history)
so we don't have the circular buffer issues?
-- richard


Something like .zfs/history/history sounds nice, but remember this is information per pool, not file system.

And i believe we want a circular buffer, i would hate for my storage to slowly get eaten over time without a way of getting it back (yes, the amount of space taken should be small, but there might be a few who switch properties on thousands of file systems weekly or something else weird). And i definitely don't want to add a way that the admin can delete history on purpose.

eric

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to