2020-02-18 15:54:27 -05:00
|
|
|
"""Test hook for verifying orphan documents are eventually deleted in a sharded cluster."""
|
|
|
|
|
|
|
|
|
|
import os.path
|
|
|
|
|
|
2020-06-17 17:41:54 +03:00
|
|
|
from buildscripts.resmokelib.testing.fixtures import shardedcluster
|
|
|
|
|
from buildscripts.resmokelib.testing.hooks import jsfile
|
2020-02-18 15:54:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class CheckOrphansDeleted(jsfile.DataConsistencyHook):
|
|
|
|
|
"""Check if the range deleter failed to delete any orphan documents."""
|
|
|
|
|
|
2021-07-29 12:53:14 -04:00
|
|
|
IS_BACKGROUND = False
|
|
|
|
|
|
2020-02-18 15:54:27 -05:00
|
|
|
def __init__(self, hook_logger, fixture, shell_options=None):
|
|
|
|
|
"""Initialize CheckOrphansDeleted."""
|
|
|
|
|
|
|
|
|
|
if not isinstance(fixture, shardedcluster.ShardedClusterFixture):
|
2024-05-16 18:00:17 -04:00
|
|
|
raise ValueError(
|
|
|
|
|
f"'fixture' must be an instance of ShardedClusterFixture, but got"
|
|
|
|
|
f" {fixture.__class__.__name__}"
|
|
|
|
|
)
|
2020-02-18 15:54:27 -05:00
|
|
|
|
|
|
|
|
description = "Check orphan documents are eventually deleted"
|
|
|
|
|
js_filename = os.path.join("jstests", "hooks", "run_check_orphans_are_deleted.js")
|
2024-05-16 18:00:17 -04:00
|
|
|
super().__init__(
|
|
|
|
|
hook_logger, fixture, js_filename, description, shell_options=shell_options
|
|
|
|
|
)
|