[File] [PATCH luajit] Add Tarantool snap, xlog, run, index and vylog magic
Sergey Bronnikov
estetus at gmail.com
Mon Sep 28 03:07:18 EDT 2026
From: Sergey Bronnikov <sergeyb at tarantool.org>
Hello,
Tarantool is an in-memory database [1]. The patch adds support for
Tarantool file formats. Each test file is a valid file that is
successfully accepted by the Tarantool. One can verify this using
the following Lua chunk:
tarantool -e "
> for _, type in ipairs({'snap', 'run', 'vylog', 'xlog', 'index'}) do
local file = ('tests/tarantool-%s.testfile'):format(type)
for _, record in require('xlog').pairs(file) do
require('log').info(record)
end
end"
1. https://www.tarantool.io/
---
magic/Magdir/tarantool | 33 +++++++++++++++++++++++++++++++++
magic/Makefile.am | 1 +
tests/Makefile.am | 10 ++++++++++
tests/tarantool-index.result | 1 +
tests/tarantool-index.testfile | Bin 0 -> 227 bytes
tests/tarantool-run.result | 1 +
tests/tarantool-run.testfile | Bin 0 -> 133 bytes
tests/tarantool-snap.result | 1 +
tests/tarantool-snap.testfile | Bin 0 -> 162 bytes
tests/tarantool-vylog.result | 1 +
tests/tarantool-vylog.testfile | Bin 0 -> 231 bytes
tests/tarantool-xlog.result | 1 +
tests/tarantool-xlog.testfile | 7 +++++++
13 files changed, 56 insertions(+)
create mode 100644 magic/Magdir/tarantool
create mode 100644 tests/tarantool-index.result
create mode 100644 tests/tarantool-index.testfile
create mode 100644 tests/tarantool-run.result
create mode 100644 tests/tarantool-run.testfile
create mode 100644 tests/tarantool-snap.result
create mode 100644 tests/tarantool-snap.testfile
create mode 100644 tests/tarantool-vylog.result
create mode 100644 tests/tarantool-vylog.testfile
create mode 100644 tests/tarantool-xlog.result
create mode 100644 tests/tarantool-xlog.testfile
diff --git a/magic/Magdir/tarantool b/magic/Magdir/tarantool
new file mode 100644
index 00000000..4f792e93
--- /dev/null
+++ b/magic/Magdir/tarantool
@@ -0,0 +1,33 @@
+#------------------------------------------------------------------------------
+# $File: tarantool,v 1.1 2026/09/26 00:00:00 christos Exp $
+# tarantool: file(1) magic for Tarantool database files
+#
+# Tarantool (https://www.tarantool.io/) has its own storage formats.
+# Every file starts with a textual header:
+#
+# <type>\n
+# <format version>\n
+# Version: <tarantool version>\n
+# Instance: <uuid>\n
+# [VClock: {...}\n]
+# [PrevVClock: {...}\n]
+# \n
+#
+# followed by binary data. The type is one of SNAP (snapshot),
+# XLOG (write-ahead log), RUN (vinyl data file), INDEX (vinyl page
+# index) or VYLOG (vinyl log).
+
+0 string SNAP\n Tarantool snapshot
+>&0 regex/16 [0-9]+\\.[0-9]+ \b, format version %s
+
+0 string XLOG\n Tarantool write-ahead log
+>&0 regex/16 [0-9]+\\.[0-9]+ \b, format version %s
+
+0 string RUN\n Tarantool vinyl run
+>&0 regex/16 [0-9]+\\.[0-9]+ \b, format version %s
+
+0 string INDEX\n Tarantool vinyl index
+>&0 regex/16 [0-9]+\\.[0-9]+ \b, format version %s
+
+0 string VYLOG\n Tarantool vinyl log
+>&0 regex/16 [0-9]+\\.[0-9]+ \b, format version %s
diff --git a/magic/Makefile.am b/magic/Makefile.am
index ff116da2..16efc5a0 100644
--- a/magic/Makefile.am
+++ b/magic/Makefile.am
@@ -318,6 +318,7 @@ $(MAGIC_FRAGMENT_DIR)/symbos \
$(MAGIC_FRAGMENT_DIR)/sysex \
$(MAGIC_FRAGMENT_DIR)/sysstat \
$(MAGIC_FRAGMENT_DIR)/tapebackup \
+$(MAGIC_FRAGMENT_DIR)/tarantool \
$(MAGIC_FRAGMENT_DIR)/tcl \
$(MAGIC_FRAGMENT_DIR)/teapot \
$(MAGIC_FRAGMENT_DIR)/terminfo \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 32b35c1c..cbaa3f43 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -155,6 +155,16 @@ rpm-v3.0-src.testfile \
searchbug.magic \
searchbug.result \
searchbug.testfile \
+tarantool-index.result \
+tarantool-index.testfile \
+tarantool-run.result \
+tarantool-run.testfile \
+tarantool-snap.result \
+tarantool-snap.testfile \
+tarantool-vylog.result \
+tarantool-vylog.testfile \
+tarantool-xlog.result \
+tarantool-xlog.testfile \
uf2.result \
uf2.testfile \
utf16xmlsvg.testfile \
diff --git a/tests/tarantool-index.result b/tests/tarantool-index.result
new file mode 100644
index 00000000..fff78b12
--- /dev/null
+++ b/tests/tarantool-index.result
@@ -0,0 +1 @@
+Tarantool vinyl index, format version 0.13
diff --git a/tests/tarantool-index.testfile b/tests/tarantool-index.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..9e9ecfbc472cf43e6533aadb6049e52a930863c3
GIT binary patch
literal 227
zcmebDb8(H}GSD+L<_b$KD$dN$vr;hDv(PitHPB5 at H8U|zv#>}sO*Kg7^2{qPNz6-5
zwNgkivox_tvPjW2OifPIH8C|b(@io-P0=+ at G)y%#O-o8kOfux+y1I*dbrHk4l>tYD
zmoq>>BST6%<3vWLiHyw5EX=HooD(NAvL11ONWw at C5CbZv0Agccs3a3if}@3rk(q&&
cfs>(;A+?P$f=QEwk#!;?vltuqRe`l{0V5PD4*&oF
literal 0
HcmV?d00001
diff --git a/tests/tarantool-run.result b/tests/tarantool-run.result
new file mode 100644
index 00000000..410d8592
--- /dev/null
+++ b/tests/tarantool-run.result
@@ -0,0 +1 @@
+Tarantool vinyl run, format version 0.13
diff --git a/tests/tarantool-run.testfile b/tests/tarantool-run.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..4435ee46d668d0dbb6e96fcea426a8d3525af4a2
GIT binary patch
literal 133
zcmWFv_2V+oGc at K3OD!tS%+Iq at FxIosGt@QEO;0s5F;26vNHk3~Napg)D=taQOHQ>?
zNHMcCu}HE=(KSp>PSiCqH8j&rGD%I*HBK~4H8f32N=r;K<l?%zi+i;g!?`0eenQI`
fAfSnXiJ7 at kaT4Rg#72g+M#dv7An~gLYu^F at lb|HE
literal 0
HcmV?d00001
diff --git a/tests/tarantool-snap.result b/tests/tarantool-snap.result
new file mode 100644
index 00000000..555881dc
--- /dev/null
+++ b/tests/tarantool-snap.result
@@ -0,0 +1 @@
+Tarantool snapshot, format version 0.13
diff --git a/tests/tarantool-snap.testfile b/tests/tarantool-snap.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..c4cc1537596418eb1aebc3dfa71112fef266275d
GIT binary patch
literal 162
zcmWIca}3}z&@(jV3QH|2&dkrVQZUxD&@<FE&`nP at GciuHut+pbHAv?2%quQQ%u7zS
zQb;s6GD}V~O4c<?N=(u<F)=jOwKPsj(={_PH#Sa6GD=N0u;2=F&dE>Cwo<6B<>I=!
zi+i;?!?_37#NRAufPfYTCMHH^MwZi#x7IZ)pAl?o5;)5!p*a0469ePIlBKz+xg`}0
L4HK>ktbGdrq9if1
literal 0
HcmV?d00001
diff --git a/tests/tarantool-vylog.result b/tests/tarantool-vylog.result
new file mode 100644
index 00000000..f3f9697a
--- /dev/null
+++ b/tests/tarantool-vylog.result
@@ -0,0 +1 @@
+Tarantool vinyl log, format version 0.13
diff --git a/tests/tarantool-vylog.testfile b/tests/tarantool-vylog.testfile
new file mode 100644
index 0000000000000000000000000000000000000000..b76d5bf72b85e43da0e37fef0875f9ff97c0d0e9
GIT binary patch
literal 231
zcmWHG^znD+GSD+L<_b$KD$dN$vr;hDv(PitHPB5 at H8U|zv#>}sO*Kg7^2{qPNz6-5
zwNgkivox_tvPjW2OifPIH8C|b(@io-P0=+ at G)y%#O-o8kOfuvObI!?6&bCshHndVO
zuI1vox{G^tI>R~9j_3Bv86cpMfvHh(5<@H7StbVdiOoyXGE;L>7?zY&7No8y%`47K
z&r3~NRh(Z`5}#j`l3KJlu{fEBiI<6!8KRN3nTd&$S%4A3V`^lCvN)O<8JU<kpsKhV
Jt_rMu3jl3ILht|p
literal 0
HcmV?d00001
diff --git a/tests/tarantool-xlog.result b/tests/tarantool-xlog.result
new file mode 100644
index 00000000..6afdeb6d
--- /dev/null
+++ b/tests/tarantool-xlog.result
@@ -0,0 +1 @@
+Tarantool write-ahead log, format version 0.13
diff --git a/tests/tarantool-xlog.testfile b/tests/tarantool-xlog.testfile
new file mode 100644
index 00000000..2a54a86c
--- /dev/null
+++ b/tests/tarantool-xlog.testfile
@@ -0,0 +1,7 @@
+XLOG
+0.13
+Version: 3.8.1-0-ge643f88a5e0c
+Instance: d6948b8d-1eca-4516-b4ed-3a1e15fbfab1
+VClock: {1: 3}
+
+Õí
\ No newline at end of file
--
2.55.0
More information about the File
mailing list