Genezzo::Contrib::Clustered - Shared data cluster support for Genezzo


Genezzo-Contrib-Clustered documentation  | view source Contained in the Genezzo-Contrib-Clustered distribution.

Index


NAME

Top

Genezzo::Contrib::Clustered - Shared data cluster support for Genezzo

SYNOPSIS

Top

  genprepundo.pl

  gendba.pl
  >@havok.sql
  >@syshook.sql
  >@clustered.sql

DESCRIPTION

Top

Genezzo is an extensible database with SQL and DBI. It is written in Perl. Basic routines inside Genezzo are overridden via Havok SysHooks. Override routines provide support for shared data clusters. Routines provide transactions, distributed locking, undo, and recovery.

Undo File Format

All blocks are $Genezzo::Block::Std::DEFBLOCKSIZE

  (block 0)

Frozen data structure stored via Genezzo::Block::RDBlock->HPush()

  {
     "procs" => $processes,
     "blocks_per_proc" => $blocks_per_process,
     "files" => {
	 per fileidx =>
	 { fileidx, filename, full_filename, blocksize, numblocks, hdrsize }
     }
  };

Process Status Block

  (block 1 to $processes+1)

 ----------processid(10)================= to end of block

 1st character is status:

    - = clear
    C = committed
    R = rolledback
    P = pending

Undo Blocks

  (array of $blocks_per_process * $processes)

These are written paired (for recoverability), so only half number is actually available.

Undo blocks contain multiple rows. 1st row is {"tx"}, a transaction id. following rows are {"f" = $fileno, "b" = $blockno}. All are Frozen data structures stored via Genezzo::Block::RDBlock->HPush().

The list of fileno/blockno indicate which blocks should be replaced if the transaction rolls back, or which blocks should have the process id cleared if the transaction commits.

At process startup undo blocks for the process are initially all written with tx 0, so we can distinguish when we move to a block left over from a previous transaction.

Before-Image Block Storage

The before image of each block is written at the tail of the file where it originates, at position $declared_file_length + $blocknum. So when this module is enabled data files actually grow to twice their declared size. Note dynamic data file growth (increase_by) is not supported with this module.

While a transaction is in progress blocks in the main portion of the file will contain the process id (PID) of the active process. Before-image blocks at the tail of the file should always have PIDs of 0 (or unset).

FUNCTIONS

Top

ReadBlock

Replaces Genezzo::BufCa::BCFile::_filereadblock

DirtyBlock

Wraps Genezzo::BufCa::DirtyScalar::STORE

_init_filewriteblock

Called by Genezzo::BufCa::BCFile::_filewriteblock

Commit

Wraps Genezzo::GenDBI::Kgnz_Commit

Rollback

Wraps Genezzo::GenDBI::Kgnz_Rollback

Execute

Wraps Genezzo::GenDBI::Kgnz_Execute (experimental!)

EXPORT

none

LIMITATIONS

Top

This is pre-alpha software; don't use it to store any data you hope to see again!

See README for current TODO list.

SEE ALSO

Top

http://www.genezzo.com

http://eric_rollins.home.mindspring.com/genezzo/ClusteredGenezzoDesign.html

http://eric_rollins.home.mindspring.com/genezzo/cluster.html

http://opendlm.sourceforge.net/

AUTHOR

Top

Eric Rollins, rollins@acm.org

COPYRIGHT AND LICENSE

Top


Genezzo-Contrib-Clustered documentation  | view source Contained in the Genezzo-Contrib-Clustered distribution.