Seqdb_management



Management routines for Seqdb files

Viewing and changing the superblock

The fct tool allows the user to view and change the superblock (among other things). To look at the superblock, call it like

 fct superblock file.data 

which outputs something like

Superblock contents:
  DTOTSZ  :           254377116 
  HAVEDUPS:                   1 
  FORMAT  :                  16 (kvseq)
  ITOTSZ  :           112136172 
  HTALGO  :                   1 (MD5)
  HAVEAO  :                   1 
  ENTRIES :              397645 
  SBSIZE  :                4096 
  FILESIZE:           372283222 
  PURPOSE : 5067492219884229697 (FSYSDATA)
  ALIGN   :                   0 
  AENTRIES:              397645 
  VALREPR :                   3 (variable length up to 8 Ebytes (exa bytes))
  FILEINCR:             4194304 
  ISZ     :                 512 
  SYNCTIME:          1200913506 
  KVDELFL :                   1 
  KEYREPR :                   0 (variable length up to 255 bytes)
  SYNCSIZE:           372283222 

For the interpretation of these fields, look at Seqdb_containers.Sb_consts.

Some interpretation hints:

With a command like

 fct superblock file.data -set ISZ 256 

one can change the variables of the superblock. This is seldom a good idea, but sometimes nevertheless useful:

Other functions of fct

With -help you can get the list of functions:

usage: fct <command> <options> <args>
<command> is one of the following:
  superblock: Show/modify the superblock
  create: Create new files (kvseq/hindex/perm)
  add: Add entries to files
  list: List entries in files
  get: Get an entry from file(s)
  group: Group a perm file by keys
<options> and <args> depend on the command you are issuing.
use 'fct <command> -help' to get command-specific help.

Especially, the create command is useful to create empty kvseq, hindex, or perm files.

Doing compaction runs of file systems

If a Seqdb file system wastes too much space, it might be advisable to do a compaction run. This means that the existing entries are iterated, and the entries are transferred from the original file system to a copy. Finally, the copy is renamed so it replaces the original.

A compaction run is also a chance to change some fundamental parameters of file sytems, e.g. the index type.

In order to start a compaction run, just do

filesys compact <fsysname>

where <fsysname> is the name of the file system without suffixes (e.g. foo if the files are called foo.data, foo.idx, and foo.lock).

Some notes:

Reindexing file systems

If the index of a file system becomes too full, it is required to enlarge the index. There is a procedure called reindexing that iterates over the entries of a file system, and writes all indexable information into a new index. This way, the size of the index can be changed.

In order to start a reindex run, just do

filesys reindex -index-size <n> <fsysname>

where <fsysname> is the name of the file system without suffixes (e.g. foo if the files are called foo.data, foo.idx, and foo.lock), and <n> is the new size of the index (given in the maximum number of entries of the hash table).

Some notes:

Repairing file systems

After a system crash the checkpointing mechanism prevents that the not-yet-synced parts of the file system are trusted. This is a simple mechanism to protect the core structure of the system, but not a full solution against errors in the file system. In particular, it may happen that inodes contain bad pointers.

The repair procedure iterates over all inodes, and deletes the bad ones. In order to repair, just do

filesys repair <fsysname>

where <fsysname> is the name of the file system without suffixes (e.g. foo if the files are called foo.data, foo.idx, and foo.lock).

Some notes:

Other functions of filesys

The filesys tool has a few other commands:

usage: filesys <command> <options> <args>
<command> is one of the following:
  create: Create a filesys
  get: Get a file from the filesys
  put: Put a file into the filesys
  list: List the contents of a filesys
  delete: Delete a file in the filesys
  rename: Rename a file in the filesys
  reindex: Create a new index for a filesys
  compact: Compact the filesys
  rollback: Rollback filesys to last checkpoint
  repair: Rollback & repair filesys
<options> and <args> depend on the command you are issuing.
use 'filesys <command> -help' to get command-specific help.