Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
S slapos.core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 23
    • Merge requests 23
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • slapos.core
  • Merge requests
  • !423

Merged
Created Sep 19, 2022 by Xavier Thompson@xavier_thompsonOwner

slapproxy: Make rows unique for forwarded requests

  • Overview 17
  • Commits 6
  • Changes 11

Avoid bloating the proxy database due to each instance processing adding the same entries for forwarded requests as duplicate rows again and again, leading to unbounded growth.

The code for adding the entries to the database already seemed to do the right thing by using INSERT OR REPLACE, but that SQLite command is a bit misleading: it only replaces existing rows that have the same values if the insertion would cause a UNIQUE or PRIMARY KEY constraint violation, so this only works as intended if the inserted combination of keys is marked as unique when the table is created. See https://www.sqlite.org/lang_conflict.html.

To fix this, the keys of the forwarded_partition_request table are now constrained together as a PRIMARY KEY.

Edited Sep 23, 2022 by Xavier Thompson
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: fix/slapproxy-forwarded-requests-database-bloat
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7