Skip to content

Instantly share code, notes, and snippets.

View raphaelsc's full-sized avatar
😄

Raphael Raph Carvalho raphaelsc

😄
View GitHub Profile
@raphaelsc
raphaelsc / gist:68b64532905065171f652bd7591d3109
Created April 29, 2025 17:31
reproducer for missing data post merge
#
# Copyright (C) 2025-present ScyllaDB
#
# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
#
from test.pylib.internal_types import ServerInfo
from test.pylib.manager_client import ManagerClient
from test.pylib.rest_client import inject_error_one_shot, read_barrier
from test.pylib.tablets import get_all_tablet_replicas
@pytest.mark.asyncio
@skip_mode('release', 'error injections are not supported in release mode')
async def test_data_resurrection_with_repair_mode(manager):
cfg = {}
cmdline = [
"--enable-cache", "0",
"--smp", "1"]
property_file_cfg = {"dc": "dc1", "rack": "r1"}
node1 = await manager.server_add(cmdline=cmdline, config=cfg, property_file=property_file_cfg)
node2 = await manager.server_add(cmdline=cmdline, config=cfg, property_file=property_file_cfg)
@pytest.mark.asyncio
@skip_mode('release', 'error injections are not supported in release mode')
async def test_data_resurrection_with_repair_mode(manager):
cfg = {'tablets_mode_for_new_keyspaces': 'enabled'}
cmdline = [
"--enable-cache", "0",
"--smp", "1"]
node1 = await manager.server_add(cmdline=cmdline, config=cfg)
node2 = await manager.server_add(cmdline=cmdline, config=cfg)
node3 = await manager.server_add(cmdline=cmdline, config=cfg)
#!/usr/bin/env python3
import argparse
import os
import sys
import subprocess
import json
import time
from collections import defaultdict
# Reproduces assert failure when truncating table, either triggered by DROP TABLE or TRUNCATE.
# See: https://github.com/scylladb/scylladb/issues/18059
# It's achieved by migrating a tablet away that contains the highest replay position of a shard,
# so when drop/truncate happens, the highest replay position will be greater than all the data
# found in the table (includes data in memtable).
@pytest.mark.asyncio
@pytest.mark.parametrize("operation", ['DROP TABLE', 'TRUNCATE'])
@skip_mode('release', 'error injections are not supported in release mode')
async def test_drop_table_and_truncate_after_migration(manager: ManagerClient, operation):
cmdline = [ '--smp=2' ]
#!/usr/bin/env python3
import argparse
import os
import sys
import subprocess
import json
import time
from collections import defaultdict
#!/usr/bin/env python3
import argparse
import os
from collections import defaultdict
import struct
import sys
import re
import uuid
import time
#!/usr/bin/env python3
import argparse
import binascii
import struct
import itertools
import operator
import statistics
import textwrap
import struct
#!/usr/bin/env python3
import argparse
import os
from collections import defaultdict
import struct
import sys
import re
import uuid
import time
# Reproducer for https://github.com/scylladb/scylladb/issues/19052
# 1) table A has N tablets and views
# 2) migration starts for a tablet of A from node 1 to 2.
# 3) migration is at write_both_read_old stage
# 4) coordinator will push writes to both nodes
# 5) A has view, so writes to it will also result in reads (table::push_view_replica_updates())
# 6) tablet's update_effective_replication_map() is not refreshing tablet sstable set (for new tablet migrating in)
# 7) so read on step 5 is not being able to find sstable set for tablet migrating in
@pytest.mark.asyncio
@skip_mode('release', 'error injections are not supported in release mode')