Skip to content

bugfix: scope partition maintenance to target table and lock create path#271

Merged
TheWitness merged 1 commit intoCacti:developfrom
somethingwithproof:bug/partition-table-lock-fix
Mar 16, 2026
Merged

bugfix: scope partition maintenance to target table and lock create path#271
TheWitness merged 1 commit intoCacti:developfrom
somethingwithproof:bug/partition-table-lock-fix

Conversation

@somethingwithproof
Copy link
Contributor

Summary

Fixes #254

Validation

  • php -l functions.php
  • php -l tests/regression/issue254_partition_table_locking_test.php
  • php tests/regression/issue254_partition_table_locking_test.php

Copilot AI review requested due to automatic review settings March 7, 2026 00:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes syslog partition maintenance so it correctly targets the requested table (e.g., syslog_removed), adds a guardrail for which tables are eligible for partition operations, and serializes partition creation to avoid concurrent “duplicate partition” errors.

Changes:

  • Scope information_schema.partitions checks/removals to the $table argument instead of hardcoding syslog.
  • Add syslog_partition_table_allowed() allowlist and use MySQL GET_LOCK/RELEASE_LOCK to serialize partition creation.
  • Add a regression test that verifies table scoping, lock usage, and the presence of the allowlist helper; update changelog for #254.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
functions.php Scopes partition queries to the target table, adds allowlist guard, and adds locking around partition creation.
tests/regression/issue254_partition_table_locking_test.php Adds a regression check ensuring table scoping and lock acquisition/release are present.
CHANGELOG.md Records the fix for issue #254 under the develop section.

@somethingwithproof somethingwithproof force-pushed the bug/partition-table-lock-fix branch 2 times, most recently from ed9f697 to e13b1c4 Compare March 10, 2026 20:30
somethingwithproof added a commit to somethingwithproof/plugin_syslog that referenced this pull request Mar 10, 2026
Refs Cacti#271

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof somethingwithproof force-pushed the bug/partition-table-lock-fix branch from e13b1c4 to c9ea44d Compare March 10, 2026 20:55
somethingwithproof added a commit to somethingwithproof/plugin_syslog that referenced this pull request Mar 12, 2026
Refs Cacti#271

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof somethingwithproof force-pushed the bug/partition-table-lock-fix branch from c9ea44d to ad8a47e Compare March 12, 2026 00:21
Refs Cacti#271

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof somethingwithproof force-pushed the bug/partition-table-lock-fix branch from ad8a47e to 8b8e566 Compare March 15, 2026 05:16
@TheWitness TheWitness merged commit 6f1a5a9 into Cacti:develop Mar 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: partition existence check hardcodes table name 'syslog', breaks syslog_removed and allows race condition

3 participants