BFS - ToDo, November 5th, 2008
-----

BlockAllocator

 - the BlockAllocator is only slightly optimized
 - the allocation policies will have to stand against some real world tests


DataStream

 - Inode::GrowStream(): merging of block_runs doesn't work between range/block boundaries


Queries

 - There shouldn't be any cases where you can speed up a query with reordering the query expression - test it
 - check if the query has to be checked for a live update


BPlusTree

 - BPlusTree::Remove() could trigger CachedNode::Free() to go through the free nodes list and free all pages at the end of the data stream
 - BPlusTree::Remove() could let the tree shrink (simple kind of reorganization)
 - updating the TreeIterators doesn't work yet for duplicates (which may be a problem if a duplicate node will go away after a remove)
 - BPlusTree::RemoveDuplicate() could merge the contents of duplicate node with only a few entries to save some space (right now, only empty nodes are freed)


Inode

 - exchange Inode::OldLastModified() with Inode::NewLastModified(), and don't change the last_modified field directly in Inode::WriteAt() for consistency in case of a crash
 - the size is only updated in bfs_close() - but if the system crashes before, the entry in the size index doesn't match the one in the inode anymore - it would be better to let the data.size not reflect the real file size in this case (since the max_xxx_range entries are always correct)
 - Inode::FillGapWithZeros() currently disabled; apart from being slow, it really shouldn't be executed while a transaction is running, because that stops all other threads from doing anything (which can be a long time for a 100 MB file)


Indices

 - consider Index::UpdateLastModified() writing back the updated inode
 - clearing up Index::Update() and live query update (seems to be a bit confusing right now)
 - investigate adding an index cache to improve performance


Attributes

 - for indices, we could get the old data from there when doing a query update
 - "pos" is ignored when writing attributes in the small data section (reading works)


Future BFS

 - put more than just an inode into a block
 - make query indices useful for user oriented queries (*[Hh][Oo][Ww]?*)
 - delayed allocation to be able to make better block allocation decisions
 - if the system crashes between bfs_unlink() and bfs_remove_vnode(), the inode can be removed from the tree, but its memory is still allocated - this can happen if the inode is still in use by someone (and that's what the "chkbfs" utility is for, mainly).
 - add delayed index updating (+ delete actions to solve the issue above)
 - multiple log files, parallel transactions? (note that parallel transactions would require more locking to be done)
 - variable sized log file
 - the access to the block bitmap is currently managed using a global lock (doesn't matter as long as transactions are serialized)
 - Check permissions of the parent directories for query results
 - ...


-----
Axel Dörfler
axeld@pinc-software.de
