Skip to content
Snippets Groups Projects
Commit db40dec3 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

vinyl: free region on vylog commit instead of resetting it

region_reset() only frees memory from the last slab. As a result, if
a vylog transaction happens to use more than one slab, memory used by
vy_log.pool won't be freed, neither will it be reused, i.e. we'll get
a memory leak. Fix it by using region_free() instead of region_reset().
It's okay from performance point of view, because vylog transactions
are rare events.

Note, the master branch isn't affected to this issue, because the vylog
memory management was completely reworked there. 2.1 isn't affected
either, because there region_reset() was modified to free all slabs.
However, rather than backporting any of those commits, I think it's
more appropriate to simply use region_free().
parent 0e7c933d
No related branches found
No related tags found
No related merge requests found
......@@ -802,7 +802,7 @@ vy_log_flush(void)
return -1;
/* Success. Free flushed records. */
region_reset(&vy_log.pool);
region_free(&vy_log.pool);
stailq_create(&vy_log.tx);
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment