mirror of
				https://github.com/isar/libmdbx.git
				synced 2025-10-31 03:29:01 +08:00 
			
		
		
		
	mdbx: avoid returning MDBX_TXN_FULL error when possible.
				
					
				
			This commit is contained in:
		
				
					committed by
					
						 Leonid Yuriev
						Leonid Yuriev
					
				
			
			
				
	
			
			
			
						parent
						
							c7e05f63e6
						
					
				
				
					commit
					2f74f405ae
				
			| @@ -5201,7 +5201,7 @@ static int mdbx_txn_spill(MDBX_txn *const txn, MDBX_cursor *const m0, | |||||||
|                "by a cursor(s), use fewer cursors or increase " |                "by a cursor(s), use fewer cursors or increase " | ||||||
|                "MDBX_opt_txn_dp_limit", |                "MDBX_opt_txn_dp_limit", | ||||||
|                unspillable); |                unspillable); | ||||||
|     return MDBX_TXN_FULL; |     goto done; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   /* Подзадача: Вытолкнуть часть страниц на диск в соответствии с LRU, |   /* Подзадача: Вытолкнуть часть страниц на диск в соответствии с LRU, | ||||||
| @@ -5362,7 +5362,9 @@ static int mdbx_txn_spill(MDBX_txn *const txn, MDBX_cursor *const m0, | |||||||
|   mdbx_ensure(txn->mt_env, txn->tw.loose_count + txn->tw.dirtyroom > need / 2); |   mdbx_ensure(txn->mt_env, txn->tw.loose_count + txn->tw.dirtyroom > need / 2); | ||||||
| #endif /* xMDBX_DEBUG_SPILLING */ | #endif /* xMDBX_DEBUG_SPILLING */ | ||||||
|  |  | ||||||
|   return likely(txn->tw.loose_count + txn->tw.dirtyroom > need / 2) | done: | ||||||
|  |   return likely(txn->tw.dirtyroom + txn->tw.loose_count > | ||||||
|  |                 ((need > CURSOR_STACK) ? CURSOR_STACK : need)) | ||||||
|              ? MDBX_SUCCESS |              ? MDBX_SUCCESS | ||||||
|              : MDBX_TXN_FULL; |              : MDBX_TXN_FULL; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user