Skip to content

Commit

Permalink
WIP: Test replica expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
def- committed Oct 4, 2024
1 parent 68e54a9 commit 68db208
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2079,3 +2079,39 @@ def benchmark(self) -> MeasurementSource:
"""
)
)


class ReplicaExpiration(Scenario):
def init(self) -> list[Action]:
return [
TdAction(
f"""
> CREATE TABLE events (
content TEXT,
event_ts TIMESTAMP
);
> CREATE VIEW last_30_days AS
SELECT event_ts, content
FROM events
WHERE mz_now() <= event_ts + INTERVAL '30 days';
"""
),
]

def benchmark(self) -> MeasurementSource:
return Td(
dedent(
f"""
> DELETE FROM events;
> SELECT 1;
/* A */
1
> INSERT INTO events SELECT concat('somelongstringthatdoesntmattermuchatallbutrequiresmemorytostoreXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', x::text), now() FROM generate_series(1, {self.n() * 10}) AS x
> SELECT 1;
/* B */
1
"""
)
)

0 comments on commit 68db208

Please sign in to comment.