Skip to content

Commit 7c985c2

Browse files
authored
chore(meta): update compatibility chart (#18317)
1 parent 0326bc4 commit 7c985c2

File tree

5 files changed

+127
-1
lines changed

5 files changed

+127
-1
lines changed

licenserc.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ excludes = [
99
"tools",
1010
"benchmark",
1111
"src/common/compress/tests",
12+
"src/meta/compat.py",
1213
# licensed under Elastic License 2.0
1314
"src/binaries/query/ee_main.rs",
1415
"src/meta/binaries/meta/ee_main.rs",

src/meta/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ History versions that are not included in the above chart:
103103
| [0.9.41, 1.2.212) | [0.9.41, 1.2.212) |
104104
| [1.2.212, 1.2.479) | [0.9.41, 1.2.479) |
105105
| [1.2.479, 1.2.655) | [1.2.288, 1.2.655) |
106-
| [1.2.655, +∞) | [1.2.288, +∞) |
106+
| [1.2.655, 1.2.769) | [1.2.288, 1.2.769) |
107+
| [1.2.769, +∞) | [1.2.547, +∞) |
107108

108109

109110
![Image](https://github.com/user-attachments/assets/f63d80ee-f646-4d6a-9bec-be607e47088d)

src/meta/compat.py

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import semantic_version
2+
import matplotlib.pyplot as plt
3+
import matplotlib.patches as patches
4+
5+
meta_to_query_compat = [
6+
# upto meta version(exclusive) : compatible query version(left open, right closed)
7+
8+
"0.0.0 0.0.0 0.0.0 ",
9+
"0.8.30 0.0.0 0.0.0 ",
10+
"0.8.35 0.7.59 0.8.80 ",
11+
"0.9.23 0.7.59 1.1.34 ",
12+
"0.9.42 0.8.80 1.1.34 ",
13+
"1.1.32 0.9.41 1.1.34 ",
14+
"1.2.226 0.9.41 1.2.287 ",
15+
"1.2.258 0.9.41 1.2.361 ",
16+
"1.2.663 0.9.41 1.2.726 ",
17+
"1.2.677 1.2.287 1.2.726 ",
18+
"1.2.755 1.2.676 ∞ ",
19+
"1.2.756 1.2.676 ∞ ",
20+
"1.2.764 1.2.676 ∞ ",
21+
"∞ 1.2.676 ∞ ",
22+
]
23+
24+
def draw_meta_to_query_compat(output_file: str):
25+
fig, ax = plt.subplots(figsize=(12, 8))
26+
27+
# Parse compatibility data and collect all unique versions
28+
ranges = []
29+
all_meta_versions = set()
30+
all_query_versions = set()
31+
32+
for i, line in enumerate(meta_to_query_compat):
33+
if line.strip():
34+
meta, q_from, q_to = line.strip().split()
35+
36+
# Skip empty ranges
37+
if q_from == "0.0.0" and q_to == "0.0.0":
38+
continue
39+
40+
ranges.append((meta, q_from, q_to))
41+
all_meta_versions.add(meta)
42+
all_query_versions.add(q_from)
43+
all_query_versions.add(q_to)
44+
45+
# Sort versions and create position mappings
46+
def version_key(v):
47+
if v == "∞":
48+
return (999, 999, 999)
49+
ver = semantic_version.Version(v)
50+
return (ver.major, ver.minor, ver.patch)
51+
52+
sorted_meta_versions = sorted(all_meta_versions, key=version_key)
53+
sorted_query_versions = sorted(all_query_versions, key=version_key)
54+
55+
# Create position mappings
56+
meta_pos = {v: i for i, v in enumerate(sorted_meta_versions)}
57+
query_pos = {v: i for i, v in enumerate(sorted_query_versions)}
58+
59+
# Create compatibility rectangles
60+
for i, (meta, q_from, q_to) in enumerate(ranges):
61+
# Get positions
62+
meta_x = meta_pos[meta]
63+
q_from_y = query_pos[q_from]
64+
q_to_y = query_pos[q_to]
65+
66+
# Determine the width of the rectangle (next meta version - current)
67+
next_meta_idx = sorted_meta_versions.index(meta) + 1
68+
if next_meta_idx < len(sorted_meta_versions):
69+
width = meta_pos[sorted_meta_versions[next_meta_idx]] - meta_x
70+
else:
71+
width = 1.0 # Width for the last range
72+
73+
# Height of the rectangle
74+
height = q_to_y - q_from_y
75+
76+
# Create rectangle patch
77+
rect = patches.Rectangle(
78+
(meta_x, q_from_y),
79+
width,
80+
height,
81+
linewidth=1,
82+
edgecolor='darkgreen',
83+
facecolor='lightgreen',
84+
alpha=0.7
85+
)
86+
ax.add_patch(rect)
87+
88+
# Set up the plot
89+
ax.set_xlim(-0.5, len(sorted_meta_versions) - 0.5)
90+
ax.set_ylim(-0.5, len(sorted_query_versions) - 0.5)
91+
ax.set_xlabel('Meta Version', fontsize=12, fontweight='bold')
92+
ax.set_ylabel('Compatible With Query', fontsize=12, fontweight='bold')
93+
ax.set_title('Databend-Meta/Query Version Compatibility Chart', fontsize=14, fontweight='bold')
94+
95+
# Add grid
96+
ax.grid(True, alpha=0.3)
97+
98+
# Set ticks with version labels
99+
ax.set_xticks(range(len(sorted_meta_versions)))
100+
ax.set_xticklabels([v if v != "∞" else "+∞" for v in sorted_meta_versions], rotation=45)
101+
102+
ax.set_yticks(range(len(sorted_query_versions)))
103+
ax.set_yticklabels([v if v != "∞" else "+∞" for v in sorted_query_versions])
104+
105+
# Add legend
106+
legend_patch = patches.Patch(color='lightgreen', label='Compatible Query Versions')
107+
ax.legend(handles=[legend_patch], loc='upper left')
108+
109+
# Save the plot
110+
plt.tight_layout()
111+
plt.savefig(output_file, dpi=300, bbox_inches='tight')
112+
plt.close()
113+
114+
print(f"Compatibility chart saved to {output_file}")
115+
116+
117+
if __name__ == "__main__":
118+
output_file = "compatibility_chart.png"
119+
draw_meta_to_query_compat(output_file)
120+
print(f"Chart generated: {output_file}")
121+
122+
123+

src/meta/compatibility_chart.png

184 KB
Loading

src/meta/service/src/version.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ pub(crate) mod raft {
117117
del_provide(("install_snapshot", 0), "2024-05-21", (1, 2, 479)),
118118
del_provide(("install_snapshot", 2), "2024-07-02", (1, 2, 552)),
119119
add_provide(("install_snapshot", 3), "2024-07-02", (1, 2, 552)),
120+
del_provide(("install_snapshot", 1), "2025-07-02", (1, 2, 769)),
120121
];
121122

122123
/// The client features that raft server depends on.

0 commit comments

Comments
 (0)