hammer2 - Initial synchronization thread
[dragonfly.git] / sys / vfs / hammer2 / TODO
1
2 * recovery scan vs unmount.  At the moment an unmount does its flushes,
3   and if successful the freemap will be fully up-to-date, but the mount
4   code doesn't know that and the last flush batch will probably match
5   the PFS root mirror_tid.  If it was a large cpdup the (unnecessary)
6   recovery pass at mount time can be extensive.  Add a CLEAN flag to the
7   volume header to optimize out the unnecessary recovery pass.
8
9 * adding new pfs - freeze and force remaster
10
11 * removing a pfs - freeze and force remaster
12
13 * bulkfree - sync between passes and enforce serialization of operation
14
15 * bulkfree - signal check, allow interrupt
16
17 * bulkfree - sub-passes when kernel memory block isn't large enough
18
19 * bulkfree - limit kernel memory allocation for bmap space
20
21 * bulkfree - must include any detached vnodes in scan so open unlinked files
22              are not ripped out from under the system.
23
24 * bulkfree - must include all volume headers in scan so they can be used
25              for recovery or automatic snapshot retrieval.
26
27 * bulkfree - snapshot duplicate sub-tree cache and tests needed to reduce
28              unnecessary re-scans.
29
30 * Currently the check code (bref.methods / crc, sha, etc) is being checked
31   every single blasted time a chain is locked, even if the underlying buffer
32   was previously checked for that chain.  This needs an optimization to
33   (significantly) improve performance.
34
35 * flush synchronization boundary crossing check and current flush chain
36   interlock needed.
37
38 * snapshot creation must allocate and separately pass a new pmp for the pfs
39   degenerate 'cluster' representing the snapshot.  This theoretically will
40   also allow a snapshot to be generated inside a cluster of more than one
41   node.
42
43 * snapshot copy currently also copies uuids and can confuse cluster code
44
45 * hidden dir or other dirs/files/modifications made to PFS before
46   additional cluster entries added.
47
48 * transaction on cluster - multiple trans structures, subtrans
49
50 * inode always contains target cluster/chain, not hardlink
51
52 * chain refs in cluster, cluster refs
53
54 * check inode shared lock ... can end up in endless loop if following
55   hardlink because ip->chain is not updated in the exclusive lock cycle
56   when following hardlink.
57
58 cpdup /build/boomdata/jails/bleeding-edge/usr/share/man/man4 /mnt/x3
59
60
61         * The block freeing code.  At the very least a bulk scan is needed
62           to implement freeing blocks.
63
64         * Crash stability.  Right now the allocation table on-media is not
65           properly synchronized with the flush.  This needs to be adjusted
66           such that H2 can do an incremental scan on mount to fixup
67           allocations on mount as part of its crash recovery mechanism.
68
69         * We actually have to start checking and acting upon the CRCs being
70           generated.
71
72         * Remaining known hardlink issues need to be addressed.
73
74         * Core 'copies' mechanism needs to be implemented to support multiple
75           copies on the same media.
76
77         * Core clustering mechanism needs to be implemented to support
78           mirroring and basic multi-master operation from a single host
79           (multi-host requires additional network protocols and won't
80           be as easy).
81
82 * make sure we aren't using a shared lock during RB_SCAN's?
83
84 * overwrite in write_file case w/compression - if device block size changes
85   the block has to be deleted and reallocated.  See hammer2_assign_physical()
86   in vnops.
87
88 * freemap / clustering.  Set block size on 2MB boundary so the cluster code
89   can be used for reading.
90
91 * need API layer for shared buffers (unfortunately).
92
93 * add magic number to inode header, add parent inode number too, to
94   help with brute-force recovery.
95
96 * modifications past our flush point do not adjust vchain.
97   need to make vchain dynamic so we can (see flush_scan2).??
98
99 * MINIOSIZE/RADIX set to 1KB for now to avoid buffer cache deadlocks
100   on multiple locked inodes.  Fix so we can use LBUFSIZE!  Or,
101   alternatively, allow a smaller I/O size based on the sector size
102   (not optimal though).
103
104 * When making a snapshot, do not allow the snapshot to be mounted until
105   the in-memory chain has been freed in order to break the shared core.
106
107 * Snapshotting a sub-directory does not snapshot any
108   parent-directory-spanning hardlinks.
109
110 * Snapshot / flush-synchronization point.  remodified data that crosses
111   the synchronization boundary is not currently reallocated.  see
112   hammer2_chain_modify(), explicit check (requires logical buffer cache
113   buffer handling).
114
115 * on fresh mount with multiple hardlinks present separate lookups will
116   result in separate vnodes pointing to separate inodes pointing to a
117   common chain (the hardlink target).
118
119   When the hardlink target consolidates upward only one vp/ip will be
120   adjusted.  We need code to fixup the other chains (probably put in
121   inode_lock_*()) which will be pointing to an older deleted hardlink
122   target.
123
124 * Filesystem must ensure that modify_tid is not too large relative to
125   the iterator in the volume header, on load, or flush sequencing will
126   not work properly.  We should be able to just override it, but we
127   should complain if it happens.
128
129 * Kernel-side needs to clean up transaction queues and make appropriate
130   callbacks.
131
132 * Userland side needs to do the same for any initiated transactions.
133
134 * Nesting problems in the flusher.
135
136 * Inefficient vfsync due to thousands of file buffers, one per-vnode.
137   (need to aggregate using a device buffer?)
138
139 * Use bp->b_dep to interlock the buffer with the chain structure so the
140   strategy code can calculate the crc and assert that the chain is marked
141   modified (not yet flushed).
142
143 * Deleted inode not reachable via tree for volume flush but still reachable
144   via fsync/inactive/reclaim.  Its tree can be destroyed at that point.
145
146 * The direct write code needs to invalidate any underlying physical buffers.
147   Direct write needs to be implemented.
148
149 * Make sure a resized block (hammer2_chain_resize()) calculates a new
150   hash code in the parent bref
151
152 * The freemap allocator needs to getblk/clrbuf/bdwrite any partial
153   block allocations (less than 64KB) that allocate out of a new 64K
154   block, to avoid causing a read-before-write I/O.
155
156 * Check flush race upward recursion setting SUBMODIFIED vs downward
157   recursion checking SUBMODIFIED then locking (must clear before the
158   recursion and might need additional synchronization)
159
160 * There is definitely a flush race in the hardlink implementation between
161   the forwarding entries and the actual (hidden) hardlink inode.
162
163   This will require us to associate a small hard-link-adjust structure
164   with the chain whenever we create or delete hardlinks, on top of
165   adjusting the hardlink inode itself.  Any actual flush to the media
166   has to synchronize the correct nlinks value based on whether related
167   created or deleted hardlinks were also flushed.
168
169 * When a directory entry is created and also if an indirect block is
170   created and entries moved into it, the directory seek position can
171   potentially become incorrect during a scan.
172
173 * When a directory entry is deleted a directory seek position depending
174   on that key can cause readdir to skip entries.
175
176 * TWO PHASE COMMIT - store two data offsets in the chain, and
177   hammer2_chain_delete() needs to leave the chain intact if MODIFIED2 is
178   set on its buffer until the flusher gets to it?
179
180
181                                 OPTIMIZATIONS
182
183 * If a file is unlinked buts its descriptors is left open and used, we
184   should allow data blocks on-media to be reused since there is no
185   topology left to point at them.