* In normaliseFState(), wrap registration of the output paths and the
normal form in a single transaction to ensure that if we crash, either everything is registered or nothing is. This is for recoverability: unregistered paths in the store can be deleted arbitrarily, while registered paths can only be deleted by running the garbage collector.
This commit is contained in:
		
							parent
							
								
									d99d04e644
								
							
						
					
					
						commit
						c95b4ad290
					
				
					 6 changed files with 44 additions and 28 deletions
				
			
		|  | @ -44,7 +44,10 @@ FSId writeTerm(ATerm t, const string & suffix, FSId id) | |||
| //     debug(format("written term %1% = %2%") % (string) id %
 | ||||
| //         printTerm(t));
 | ||||
| 
 | ||||
|     registerPath(path, id); | ||||
|     Transaction txn(nixDB); | ||||
|     registerPath(txn, path, id); | ||||
|     txn.commit(); | ||||
| 
 | ||||
|     return id; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue