|
43 | 43 | VersionDef('5.6.x', []),
|
44 | 44 | VersionDef('5.7.x', []),
|
45 | 45 | VersionDef('5.8.x', []),
|
46 |
| - VersionDef('5.9.x', []), |
| 46 | + VersionDef('5.9.11', []), |
47 | 47 | VersionDef('5.10.x', []),
|
48 | 48 | ),
|
49 | 49 | (
|
|
56 | 56 | VersionDef('5.6.x', []),
|
57 | 57 | VersionDef('5.7.x', []),
|
58 | 58 | VersionDef('5.8.x', []),
|
59 |
| - VersionDef('5.9.x', []), |
| 59 | + VersionDef('5.9.11', []), |
60 | 60 | VersionDef('5.10.x', []),
|
61 | 61 | VersionDef('5.10', []),
|
62 | 62 | VersionDef('latest-nightly', [])
|
@@ -258,20 +258,22 @@ def _do_upgrade(self,
|
258 | 258 | assert_busy(lambda: self.assert_green(conn, 'blob', 'b1'))
|
259 | 259 | self.assertIsNotNone(container.get(digest))
|
260 | 260 |
|
| 261 | + accumulated_dynamic_column_names: list[str] = [] |
261 | 262 | self._process_on_stop()
|
262 | 263 | for version_def in versions[1:]:
|
263 | 264 | timestamp = datetime.utcnow().isoformat(timespec='seconds')
|
264 | 265 | print(f"{timestamp} Upgrade to: {version_def.version}")
|
265 |
| - self.assert_data_persistence(version_def, nodes, digest, paths) |
| 266 | + self.assert_data_persistence(version_def, nodes, digest, paths, accumulated_dynamic_column_names) |
266 | 267 | # restart with latest version
|
267 | 268 | version_def = versions[-1]
|
268 |
| - self.assert_data_persistence(version_def, nodes, digest, paths) |
| 269 | + self.assert_data_persistence(version_def, nodes, digest, paths, accumulated_dynamic_column_names) |
269 | 270 |
|
270 | 271 | def assert_data_persistence(self,
|
271 | 272 | version_def: VersionDef,
|
272 | 273 | nodes: int,
|
273 | 274 | digest: str,
|
274 |
| - paths: Iterable[str]): |
| 275 | + paths: Iterable[str], |
| 276 | + accumulated_dynamic_column_names: list[str]): |
275 | 277 | env = prepare_env(version_def.java_home)
|
276 | 278 | version = version_def.version
|
277 | 279 | cluster = self._new_cluster(version, nodes, data_paths=paths, settings=self.CLUSTER_SETTINGS, env=env)
|
@@ -303,15 +305,27 @@ def assert_data_persistence(self,
|
303 | 305 | cursor.execute(f'select * from versioned."{table}"')
|
304 | 306 | cursor.execute(f'insert into versioned."{table}" (id, col_int) values (?, ?)', [str(uuid4()), 1])
|
305 | 307 |
|
| 308 | + # to trigger `alter` stmt bug(https://github.com/crate/crate/pull/17178) that falsely updated the table's |
| 309 | + # version created setting |
| 310 | + cursor.execute('ALTER TABLE doc.parted SET ("refresh_interval" = 900)') |
| 311 | + |
306 | 312 | # older versions had a bug that caused this to fail
|
307 |
| - if version in ('latest-nightly', '3.2'): |
308 |
| - # Test that partition and dynamic columns can be created |
309 |
| - obj = {"t_" + version.replace('.', '_'): True} |
310 |
| - args = (str(uuid4()), version, obj) |
311 |
| - cursor.execute( |
312 |
| - 'INSERT INTO doc.parted (id, version, cols) values (?, ?, ?)', |
313 |
| - args |
314 |
| - ) |
| 313 | + # Test that partition and dynamic columns can be created |
| 314 | + key = "t_" + version.replace('.', '_') |
| 315 | + obj = {key: True} |
| 316 | + args = (str(uuid4()), version, obj) |
| 317 | + cursor.execute( |
| 318 | + 'INSERT INTO doc.parted (id, version, cols) values (?, ?, ?)', |
| 319 | + args |
| 320 | + ) |
| 321 | + assert_busy(lambda: self.assert_green(conn, 'doc', 'parted')) |
| 322 | + accumulated_dynamic_column_names.append(key) |
| 323 | + cursor.execute('SELECT cols from doc.parted') |
| 324 | + result = cursor.fetchall() |
| 325 | + for row in result: |
| 326 | + if row[0] is not None: |
| 327 | + for name in row[0].keys(): |
| 328 | + self.assertIn(name, accumulated_dynamic_column_names) |
315 | 329 | self._process_on_stop()
|
316 | 330 |
|
317 | 331 | def assert_green(self, conn: Connection, schema: str, table_name: str):
|
|
0 commit comments