Commit 74e41fb5 authored by Harish Ramachandran's avatar Harish Ramachandran Committed by Achilleas Pipinellis

Geo package verification script

parent e762a4b6
...@@ -1142,6 +1142,33 @@ registry = Geo::PackageFileRegistry.find(registry_id) ...@@ -1142,6 +1142,33 @@ registry = Geo::PackageFileRegistry.find(registry_id)
registry.replicator.send(:download) registry.replicator.send(:download)
``` ```
#### Verify package files on the secondary manually
This will iterate over all package files on the secondary, looking at the
`verification_checksum` stored in the database (which came from the primary)
and then calculate this value on the secondary to check if they match. This
won't change anything in the UI:
```ruby
# Run on secondary
status = {}
Packages::PackageFile.find_each do |package_file|
primary_checksum = package_file.verification_checksum
secondary_checksum = Packages::PackageFile.hexdigest(package_file.file.path)
verification_status = (primary_checksum == secondary_checksum)
status[verification_status.to_s] ||= []
status[verification_status.to_s] << package_file.id
end
# Count how many of each value we get
status.keys.each {|key| puts "#{key} count: #{status[key].count}"}
# See the output in its entirety
status
```
### Repository types newer than project/wiki repositories ### Repository types newer than project/wiki repositories
- `SnippetRepository` - `SnippetRepository`
...@@ -1172,15 +1199,15 @@ registry = Geo::SnippetRepositoryRegistry.find(registry_id) ...@@ -1172,15 +1199,15 @@ registry = Geo::SnippetRepositoryRegistry.find(registry_id)
registry.replicator.send(:sync_repository) registry.replicator.send(:sync_repository)
``` ```
### Generate Service Ping ## Generate Service Ping
#### Generate or get the cached Service Ping ### Generate or get the cached Service Ping
```ruby ```ruby
Gitlab::UsageData.to_json Gitlab::UsageData.to_json
``` ```
#### Generate a fresh new Service Ping ### Generate a fresh new Service Ping
This will also refresh the cached Service Ping displayed in the admin area This will also refresh the cached Service Ping displayed in the admin area
...@@ -1188,7 +1215,7 @@ This will also refresh the cached Service Ping displayed in the admin area ...@@ -1188,7 +1215,7 @@ This will also refresh the cached Service Ping displayed in the admin area
Gitlab::UsageData.to_json(force_refresh: true) Gitlab::UsageData.to_json(force_refresh: true)
``` ```
#### Generate and print ### Generate and print
Generates Service Ping data in JSON format. Generates Service Ping data in JSON format.
...@@ -1196,7 +1223,7 @@ Generates Service Ping data in JSON format. ...@@ -1196,7 +1223,7 @@ Generates Service Ping data in JSON format.
rake gitlab:usage_data:generate rake gitlab:usage_data:generate
``` ```
#### Generate and send Service Ping ### Generate and send Service Ping
Prints the metrics saved in `conversational_development_index_metrics`. Prints the metrics saved in `conversational_development_index_metrics`.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment