changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > ventivac / appl/cmd/ventisrv.b

revision 111: 8fd6132b12be
parent 89: 301697094735
child 129: 636d77883598
     1.1--- a/appl/cmd/ventisrv.b	Fri Aug 17 16:39:52 2007 +0200
     1.2+++ b/appl/cmd/ventisrv.b	Fri Aug 17 17:27:01 2007 +0200
     1.3@@ -1,15 +1,32 @@
     1.4-# ideas
     1.5-# - tool for diagnosing problems in index file and data file
     1.6+# ventisrv stores a part of each stored score in memory.  at the
     1.7+# command-line, the maximum data file size and mean block size (thus
     1.8+# expected number of scores) is given.  the scores are assumed to be
     1.9+# distributed evenly, so the number of bits of each score to keep in memory
    1.10+# in order to make the probability of a collision <0.001 is calculated.
    1.11+# now all stored scores are read from the index file and partially stored
    1.12+# in main memory.
    1.13 
    1.14+# a venti block read can result in 0 hits (data not present) or 1 or
    1.15+# more hits.  for each of the hits, the full score has to be read from
    1.16+# disk until a match is found (in which case the data will be returned and
    1.17+# further reading stopped).  it is possible none of the in-memory "hits"
    1.18+# are a hit in the data file.
    1.19+
    1.20+# a venti block write will perform the same steps as the read.  if the
    1.21+# data is not present, the header+data is written to the data file,
    1.22+# another header is written to the index file.
    1.23+
    1.24+# at startup, the index file and data file are checked.  if headers
    1.25+# are missing from the index file, they are synced with headers from the
    1.26+# data file.  missing headers in the data file are errors and ventisrv
    1.27+# will stop with a dianostic message.
    1.28+
    1.29+# possible improvements:
    1.30 # - speedup syncing index file from data file at startup?
    1.31-# - check for hash collisions when writing new blocks?
    1.32-# - queue index writes?
    1.33-# - starting up is slow.  reading index file is fast.  packing/unpacking is necessary.  inserting non-sorted at startup, and then sorting is faster, but involves unpacking the "blocks" in memory, sorting, and packing again.  premature optimisation.
    1.34-# - only compress data and dir blocks?  not pointer blocks (they have random scores).  should make sure the index file and data file remain in sync.
    1.35-
    1.36-# does not have:
    1.37-# - using raw disks for storage
    1.38-# - authentication
    1.39+# - queueing index writes may help when filesystem does synchronous writes
    1.40+# - make startup faster by reading partial scores into memory more
    1.41+#   efficiently: insert non-sorted at startup, when all has been read,
    1.42+#   sort the lists.  faster than inserting each block sorted.
    1.43 
    1.44 implement Ventisrv;
    1.45 
    1.46@@ -908,14 +925,6 @@
    1.47 	}
    1.48 }
    1.49 
    1.50-ticker(c: chan of int)
    1.51-{
    1.52-	for(;;) {
    1.53-		sys->sleep(20*1000);
    1.54-		c<- = 0;
    1.55-	}
    1.56-}
    1.57-
    1.58 main()
    1.59 {
    1.60 	writeerror: string;