Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When poller runs, memory tables may not always be present #4396

Closed
kim-fitness opened this issue Sep 10, 2021 · 7 comments
Closed

When poller runs, memory tables may not always be present #4396

kim-fitness opened this issue Sep 10, 2021 · 7 comments
Labels
bug Undesired behaviour enhancement General tag for an enhancement resolved A fixed issue
Milestone

Comments

@kim-fitness
Copy link
Contributor

Describe the bug

In cacti log, it reports that poller_output_boost_processes, poller_output_realtime are missing on the database server

To Reproduce

Cannot reproduce

Additional context

We can make en enhancement in the poller.php to check those two tables' existence (poller_output_boost_processes and poller_output_realtime). Just like what we have done for table poller_output_boost as following

// catch the unlikely event that the poller_output_boost is missing
if (!db_table_exists('poller_output_boost')) {
	db_execute('CREATE TABLE poller_output_boost LIKE poller_output');
	db_execute('ALTER TABLE poller_output_boost ENGINE=InnoDB');
}
@kim-fitness kim-fitness added bug Undesired behaviour unverified Some days we don't have a clue labels Sep 10, 2021
@bmfmancini
Copy link
Member

bmfmancini commented Sep 10, 2021 via email

@kim-fitness
Copy link
Contributor Author

kim-fitness commented Sep 10, 2021

I haven't seen this before

What version are you on?
Was it a fresh install or upgrade

I like the idea though

Hi @bmfmancini ,
It's a fresh installed 1.2.17.

Let me make a PR then.

@kim-fitness kim-fitness changed the title Two memory tables 'poller_output_boost_processes' and 'poller_output_realtime' are missing Two tables 'poller_output_boost_processes' and 'poller_output_realtime' are missing Sep 10, 2021
@TheWitness
Copy link
Member

@kim-fitness, I have not reviewed yet. Thanks for the contribution.

TheWitness added a commit that referenced this issue Sep 10, 2021
* Update CHANGELOG

* Update poller.php

* Minor spaces to tabs formatting change

Co-authored-by: TheWitness <thewitness@cacti.net>
@TheWitness TheWitness added enhancement General tag for an enhancement resolved A fixed issue bug Undesired behaviour and removed bug Undesired behaviour unverified Some days we don't have a clue labels Sep 10, 2021
@TheWitness TheWitness added this to the 1.2.19 milestone Sep 10, 2021
@TheWitness
Copy link
Member

I have merged this one. Thanks!

netniV added a commit that referenced this issue Sep 10, 2021
This reverts commit 65b2620.
@miquelmartos
Copy link

Hello,
This commit breaks the syntax of php.
Double quote must be used to set the default values.

php /opt/cacti/poller.php
PHP Parse error:  syntax error, unexpected '',' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in /opt/cacti/poller.php on line 217
index 341f28d88..61aa1a892 100755
--- a/poller.php
+++ b/poller.php
@@ -212,11 +212,11 @@ if (!db_table_exists('poller_output_boost_processes')) {
 // catch the unlikely event that the poller_output_realtime is missing
 if (!db_table_exists('poller_output_realtime')) {
        db_execute('CREATE TABLE poller_output_realtime (
-               local_data_id mediumint(8) unsigned NOT NULL default '0',
-               rrd_name varchar(19) NOT NULL default '',
-               `time` timestamp NOT NULL default '0000-00-00 00:00:00',
+               local_data_id mediumint(8) unsigned NOT NULL default "0",
+               rrd_name varchar(19) NOT NULL default "",
+               `time` timestamp NOT NULL default "0000-00-00 00:00:00",
                output text NOT NULL,
-               poller_id varchar(256) NOT NULL default '1',
+               poller_id varchar(256) NOT NULL default "1",
                PRIMARY KEY (local_data_id, rrd_name, time, poller_id),
                KEY poller_id (poller_id(191)),
                KEY `time` (`time`))

@TheWitness
Copy link
Member

Thanks and upon further review, there are additional issues.

TheWitness added a commit that referenced this issue Sep 15, 2021
Moving this to a common function.  We still need discussion on when it's best to perform table maintenance for tables like the `poller_output` table, that when this table is InnoDB, it can become fragmented, though empty and that free space can not be released without an optimize operation, which for InnoDB tables can take some time.
@TheWitness
Copy link
Member

TheWitness commented Sep 15, 2021

Please review the latest commit and comment. Our Travis commit check has been down for a while and that allowed a few of these issues to creep in. There was another syntax error corrected just last week that slipped through the cracks too.

@netniV netniV changed the title Two tables 'poller_output_boost_processes' and 'poller_output_realtime' are missing When poller runs, memory tables may not always be present Oct 3, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour enhancement General tag for an enhancement resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants