Skip to content

@table(eviction: N) disables eviction #558

@ldt1996

Description

@ldt1996

Bug Summary

setTTLExpiration({ eviction: N }) produces NaN cleanupInterval, eviction scanner never starts

Reproduction Repository (if applicable)

https://github.com/HarperFast/harper-qe-logbook/tree/main/v4-to-v5/upgrade-test-component

Steps to Reproduce

(local reproduction steps, not related to the component posted above, but same mechanism)

  1. Define a table with @table(database: "demo", eviction: 5) (no expiration: field), or call Table.setTTLExpiration({ eviction: 5 }) directly
  2. Write a record: Table.put('a', {}, { expiresAt: Date.now() + 100 })
  3. Wait 200ms
  4. Table.primaryStore.getSync('a'), record still present
  5. describe_all shows "expiration": "NaNs" on the table

Expected Behavior

Records evict after their expiresAt. describe_all shows "expiration" in seconds.

Actual Behavior

Records persist indefinitely. describe_all shows the literal string "NaNs".

Platform

Harper 4.5.x — 5.x

Console Errors

N/A

Screenshots or Videos

No response

Additional Context

Visible in describe_all:

"sem.PageCache": { "expiration": "NaNs", "sources": ["SemPageCacheSource"] }
"seo.PageCache": { "expiration": "NaNs", "sources": ["SeoPageCacheSource"] }

Are you planning to fix this issue?

Yes, I'll submit a PR to fix this

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions