[PATCH v2 5/7] Introduce _vinyl_deferred_delete system space

Vladimir Davydov vdavydov.dev at gmail.com
Wed Aug 22 20:04:59 MSK 2018


On Tue, Aug 21, 2018 at 06:42:52PM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev at gmail.com> [18/08/21 15:19]:
> > +	/*
> > +	 * _vinyl_deferred_delete - blackhole that is needed
> > +	 * for writing deferred DELETE statements generated by
> > +	 * vinyl compaction tasks to WAL.
> > +	 */
> 
> Please expand this comment to explain why we can't create this
> space purely from Lua or upgrade script: 
> 
> There is an intricate ordering dependency between creating of this
> system space, recovery, and engine initialization, when we set an
> on_replace trigger on the space. To resolve this dependency, we
> create a space stub at schema_init(), then set a trigger in
> engine_init(), which is called next, and then "alter" the space to
> its final form in recovery(), which is called next.

Done:

diff --git a/src/box/schema.cc b/src/box/schema.cc
index 32669c69..dd5896c5 100644
--- a/src/box/schema.cc
+++ b/src/box/schema.cc
@@ -357,6 +357,15 @@ schema_init()
 	 * _vinyl_deferred_delete - blackhole that is needed
 	 * for writing deferred DELETE statements generated by
 	 * vinyl compaction tasks to WAL.
+	 *
+	 * There is an intricate ordering dependency between
+	 * recovery of this system space and initialization of
+	 * the vinyl engine, when we set an on_replace trigger
+	 * on the space. To resolve this dependency, we create
+	 * a space stub in schema_init(), then set a trigger in
+	 * engine_begin_initial_recovery(), which is called next,
+	 * then recover WAL rows, executing the trigger for each
+	 * of them.
 	 */
 	{
 		const char *engine = "blackhole";



More information about the Tarantool-patches mailing list