70 Commits

Author SHA1 Message Date
Monsyne Dragon
69e04b1c3a Add Version number in logs at start.
Report the version number on startup of verifier and worker daemons
to make debugging of deployments easier.

Change-Id: Ib6f9008ab103a67d958004e7151f30065daa5a3d
2017-09-05 20:15:02 +00:00
Isham Ibrahim
1b1a5cc4c9 JIRA VIRT-2986. Added an exponential back off strategy for RabbitMQ connection failure in the callback method of the nova verifier.
Change-Id: I8a1c0d14a28e3f0f8f46ba15f14b84dc35fe10ee
2017-05-11 13:15:02 +05:30
Monsyne Dragon
f5a03f1afe Fixes for stacktach verifier processes
Fix memory usage for verifiers. Events to verify were being loaded
from the db into an in-memory fifo queue to spool to worker processes.
This was not being limited, resulting in a large amount of memory
being used if events were read from the DB faster than they were
being processed. This change pauses the loading of events if the
in-memory queue grows larger than specified batchsize.

Also, verifier child processes were not handling signals (like SIGTERM)
properly, resulting in them not shutting down properly.
Added proper signal handling.

Change-Id: Ife25ca07398acf111f4388071b5f2e4eafeecb05
2016-07-21 22:54:48 +00:00
Monsyne Dragon
0c8ee8fc40 Reset 'Verifying' notifications on verifier start.
If the stacktach verifier crashes, notifications
'in-flight' can be stuck in 'verifying' status'.

This change flips those back to 'pending' so they get
processed.

Change-Id: Ie4aabed0c4991429a3e18e3b28813917d822867a
2016-03-07 18:05:00 +00:00
Monsyne Dragon
5ac182ac4e Properly log verifier exceptions.
If an exception is thrown in the verifier child process for a
specific exchange, log it properly.

Was simply printing to stdout, which goes nowhere for daemon processes.

Change-Id: I528ad08e70d7bdf03e9a8e1d8abe45d09f2eb476
2016-03-04 21:07:17 +00:00
Monsyne Dragon
03cd412254 Fix missing import in verifier start script.
Replace accidentally removed datetime import.

Change-Id: I2476d0eb15aca37e01c522e950a23886ce70eff0
2016-02-29 21:45:09 +00:00
Monsyne Dragon
c389b8f8a9 Add watchdog for verifier processes.
Add a watchdog in parent process to check verifier child processes,
and restart if needed.

Change-Id: Icacc4c046a8f4ba949499780cdc4724c9fd54fba
2016-02-25 16:36:02 +00:00
Phillip Moore
51cb63b40c set config-filename such that verifier can start
Fixed a bug that was introduced that prevents verifier from starting
without special environment variables et

Change-Id: I5b69851c688d4fdc43343422df58ec3edde67b0e
2014-07-31 21:23:42 +00:00
Sandy Walsh
8a0f06ac79 Freshen up with latest from RackerLabs (and include tox.ini)
Added instance hours report

Initial version of report to calculate unit hours used
for nova instances

Breakdown by flavor, flavor class, account/billing types and by tenant.

Moved license so script has shebang as the first line
Add tenant info cache.
Refactor Instance hr report.
Added cache table for basic tenant info for reports.
Refactor instance_hours report to use table.
Improve performance of tenant info update.

use bulk sql operations to speed up the tenant info update,
as it's taking ~40s/1000 tenants to update on a decent machine.

Fix some tests broken by rebase. Fix unittests broken by
rebase. Also, renumber migration due to collision.

Add Apache license header to new files.

Fixed bug with fetching deployment information in
reconciler. Reverted old method for fetching
current usage's deployment and added new method to
fetch latest deployment information for
a request_id.

Made the field mismatch error message more readable
Refactored nova and glance verifier tests

the exists are updated with 201 send_status as part of stacktach down repair mechanism

Revert "Fixed bug with fetching deployment information in"

Revert "Adding host and deployment info to missing exists entries in the nova usage audit"

Revert "Added column headers for host and deployment in json reports"

Only log ERROR on last retry

fixed the wrong status name for sent_failed variable in audit report

fixing documentation for urls that are not available for glance

deprecating stacky urls (usage, deletes, exists) that are not
used anymore

Revert "Revert "Added column headers for host and deployment in json reports""

Revert "Revert "Adding host and deployment info to missing exists entries in the nova usage audit""

Revert "Revert "Fixed bug with fetching deployment information in""

Cell and compute info added for verification failures as well.
If that is not present(request_id is not populated for an
InstanceUsage entry), the cells display '-'

Add tox support for move to stackforge

Add tox support for move to stackforge

Change-Id: Id94c2a7f1f9061e972e90c3f54e39c9dec11943b
2014-05-08 15:58:03 -03:00
Sandy Walsh
eae07eecac Switched to Apache licensing 2014-03-28 11:47:16 -03:00
Manali Latkar
e2f99d8ae4 Making the type and null check for os_version optional according to import image_type 2014-03-19 17:21:40 +05:30
Manali Latkar
4144d39976 Making the type and null check for os_distro optional according to import image_type 2014-03-10 20:55:18 +05:30
Andrew Melton
e90fd6dcbf Merge pull request #267 from priy1237/NOTIFICATION_DEFAULT_VALUE_FIX
Fixed default value of notification in the verifier config file
2014-02-24 11:36:08 -05:00
Anuj Mathur
259fe6edd0 Added instance/image id and verified_at to error messages 2014-02-24 15:13:52 +05:30
Priyanka Agrawal
6142358db2 Fixed default value of notification in the verifier config file 2014-01-08 17:16:52 +05:30
Andrew Melton
0b1874fc05 Merge pull request #251 from manalilatkar/stacktach_down_scenario
stacktach picks up all exists with status sent_unverified and verifies them without sending them to yagi
2014-01-06 07:48:11 -08:00
Andrew Melton
bb6e7a6c2e Correctly handling glance verification exception 2014-01-03 16:00:36 -05:00
Manali Latkar
a9b4bedbcf stacktach picks up all exists with status sent_unverified and verifies them without sending them to yagi 2013-11-11 18:31:51 +05:30
Andrew Melton
ca0ee9f3d0 Fixing logging
First, setting up the default logger name for worker and verifier.
Without this, logging from the reconciler and the database api
will end up in stacktach-default. This would mean both the
verifier and worker will be attempting to rotate that log file,
thus locking themselves.

Second, using the child logging process when calling the
info/warn/error functions directly in stacklog. Othweise this will
cause the callers to get or create the parent logger process.
2013-11-07 10:12:55 -05:00
Andrew Melton
eaf7f9a290 Correctly ending loggers 2013-11-06 14:22:41 -05:00
Anuj Mathur
baaba5d3e7 Implemented multiprocess logging 2013-11-05 20:13:46 +05:30
Andrew Melton
3241b178b8 Attempt DB reconnection in callback 2013-11-04 16:07:02 -05:00
Anuj Mathur
26567870da Made Nova flavor field name configurable 2013-10-28 17:02:48 +05:30
Andrew Melton
ca76a05f09 Using new exist object in callback 2013-10-24 13:44:57 -04:00
Anuj Mathur
ceb7908403 - Made changes so that we verify each group of exists messages with
the same owner and raw_id separately. This ensures that if there are
  multiple exists notifications for each owner pending verification,
  we send an individual verified notification for each of them.

- Fixed race condition which was causing multiple verified messages to be
  sent by starting the async verify process per owner instead of per image.
2013-10-15 19:24:16 +05:30
Anuj Mathur
6e394705e5 Ensured that image verified event is sent only once per owner for all his images 2013-10-15 19:22:27 +05:30
Anuj Mathur
0e21b29a03 removed created_at from list of fields that are verified in image.delete verification 2013-10-15 19:22:27 +05:30
Andrew Melton
aa21a48e09 Config option for verifier event_types 2013-10-10 15:30:20 -04:00
Manali Latkar
a183818f9c removing the integer validation of flavor due to the changes in flavor field by BRM 2013-10-04 12:26:22 +05:30
Andrew Melton
46d18f4073 Merge pull request #208 from manalilatkar/owner_false_validation_fix
fixed the false 32-bit validation of tenant-id
2013-09-18 07:14:41 -07:00
Andrew Melton
9f58358860 End verifier if there are no children 2013-09-16 15:45:44 -04:00
Manali Latkar
d11ea2185a fixed the false 32-bit validation of tenant-id 2013-09-16 14:51:36 +05:30
Manali Latkar
e294145f66 Fixed type check for instance_type_id and rax_options for instanceexists and size for glanceexists
changed the order of the validity check
added validation level as flag
Added empty check for nova image properties
2013-08-27 18:40:40 +05:30
Manali Latkar
065a2d76f2 added null/type checks on specific fields of exit 2013-08-27 18:40:31 +05:30
Andrew Melton
43b7d18d37 Adding child verifiers to process list 2013-08-23 16:16:51 -04:00
Anuj Mathur
4ebdd61ed0 Revert "Merge pull request #176 from rackerlabs/master_no_glance_verify"
This reverts commit ea0b42df4842449f99ccc022e5f79bff2ebc0ba6, reversing
changes made to 510cdda0d0c6688b0ec5e9712a8beac1b1a6cb31.
2013-08-22 16:28:13 +05:30
Andrew Melton
25dbb53d1f Revert "Merge pull request #171 from manalilatkar/GlanceVerifier_222"
This reverts commit 139f9cdbead8ae85af59206b1f14c9d4044da639, reversing
changes made to 06318c44e11c7bbf1b3f425670c1194e83762201.
2013-08-19 12:08:34 -04:00
Andrew Melton
561feedb6d Revert "Merge pull request #173 from ramielrowe/master"
This reverts commit 7e912dafbe5d57c4232232244df2446a37160000, reversing
changes made to 139f9cdbead8ae85af59206b1f14c9d4044da639.
2013-08-19 12:08:11 -04:00
Andrew Melton
61792d4beb Revert "Merge pull request #175 from ramielrowe/master"
This reverts commit 510cdda0d0c6688b0ec5e9712a8beac1b1a6cb31, reversing
changes made to 7e912dafbe5d57c4232232244df2446a37160000.
2013-08-19 12:07:39 -04:00
Andrew Melton
e298bbd5a0 Injecting config in start_verifier 2013-08-19 11:16:01 -04:00
Andrew Melton
bd4d6b1e67 Injecting fake verifier config in tests 2013-08-16 16:02:35 -04:00
Andrew Melton
139f9cdbea Merge pull request #171 from manalilatkar/GlanceVerifier_222
Glance verifier 222
2013-08-16 11:06:06 -07:00
Manali Latkar
2fb32e716b fixed merge conflicts 2013-08-16 01:04:45 +05:30
Raghu Rao
0ea1373586 Added pidfile argument to the "status" command of the initscripts for worker and verifier 2013-08-13 15:54:01 -05:00
Anuj Mathur
08311b2dd4 - Created glance verifier and nova verifier
- Extracted common verifier functionality into a base verifier
- Extracted messaging specific functionality into message service
- Moved methods into models
- Moved reconciler creation into start_verifier
2013-08-05 19:19:37 +05:30
Anuj Mathur
3bee7db6f3 Refactored verifier config into a separate module 2013-08-05 14:59:57 +05:30
Andrew Melton
2a03e890b0 Marking exists reconciled at proper location 2013-07-15 13:17:21 -04:00
Andrew Melton
c3c1412cf2 Test coverage and V4 of Nova Usage Audit 2013-07-09 11:42:21 -04:00
Andrew Melton
223de7a0a4 Fixing up verification with an InstanceReconcile 2013-07-08 16:07:29 -04:00
Andrew Melton
7d66759a46 Reconciling failed verifications 2013-07-03 16:16:16 -04:00