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

t3c to use package metadata if rpm db is unhealthy #7652

Merged
merged 10 commits into from
Jul 26, 2023

Conversation

jpappa200
Copy link
Contributor

@jpappa200 jpappa200 commented Jul 17, 2023

right now if there is an issue with RPM t3c will not be able keep the cache config up to date. this PR will address this issue.
In syncds mode t3c will attempt a check of the RPM DB files, if it succeeds t3c will continue as normal. if the check fails t3c will attempt to get package data from t3c-apply-metadata.json. if package data is available t3c will use it and make an assumption that trafficserver is installed and continue with config updates. if the package data in the metadata file is unavailable it will attempt to continue without package data.
if badass mode or --install-packages=true is selected. t3c will exit with an error if rpm db check fails as packages cannot be installed without rpm.


Which Traffic Control components are affected by this PR?

  • Traffic Control Cache Config (t3c, formerly ORT)

What is the best way to verify this PR?

since it is difficult and dangerous to corrupt an rpm database the best way to test is update the config such that rpmDBisOk is set to false run t3c in different modes and check the results.

If this is a bugfix, which Traffic Control versions contained the bug?

PR submission checklist

@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #7652 (46f0259) into master (55d8070) will decrease coverage by 37.90%.
Report is 1 commits behind head on master.
The diff coverage is 5.88%.

@@              Coverage Diff              @@
##             master    #7652       +/-   ##
=============================================
- Coverage     65.10%   27.20%   -37.90%     
  Complexity       98       98               
=============================================
  Files           314      686      +372     
  Lines         12359    79755    +67396     
  Branches        905       90      -815     
=============================================
+ Hits           8046    21701    +13655     
- Misses         3961    55984    +52023     
- Partials        352     2070     +1718     
Flag Coverage Δ
golib_unit 48.26% <ø> (?)
grove_unit 4.60% <ø> (?)
t3c_unit 4.95% <5.88%> (?)
traffic_monitor_unit 21.30% <ø> (?)
traffic_ops_unit 22.68% <ø> (?)
traffic_portal_v2 ?
traffic_stats_unit 10.14% <ø> (?)
unit_tests 23.89% <5.88%> (-50.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
cache-config/t3c-apply/config/config.go 0.00% <0.00%> (ø)
cache-config/t3c-apply/t3c-apply.go 0.00% <0.00%> (ø)
cache-config/t3c-apply/torequest/torequest.go 5.83% <14.28%> (ø)

... and 587 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ocket8888 ocket8888 added bug something isn't working as intended low impact affects only a small portion of a CDN, and cannot itself break one cache-config Cache config generation labels Jul 18, 2023
Copy link
Contributor

@traeak traeak left a comment

Choose a reason for hiding this comment

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

These all look fine and test okay. Definitely not broken for the current working configuration.

cache-config/t3c-apply/config/config.go Outdated Show resolved Hide resolved
cache-config/t3c-apply/config/config.go Outdated Show resolved Hide resolved
cache-config/t3c-apply/config/config.go Outdated Show resolved Hide resolved
cache-config/t3c-apply/config/config.go Outdated Show resolved Hide resolved
cache-config/t3c-apply/t3c-apply.go Outdated Show resolved Hide resolved
cache-config/t3c-apply/torequest/torequest.go Outdated Show resolved Hide resolved
cache-config/t3c-apply/torequest/torequest.go Outdated Show resolved Hide resolved
cache-config/t3c-apply/torequest/torequest.go Outdated Show resolved Hide resolved
cache-config/t3c-apply/torequest/torequest.go Outdated Show resolved Hide resolved
cache-config/t3c-apply/torequest/torequest.go Outdated Show resolved Hide resolved
@ocket8888 ocket8888 merged commit 2233d22 into apache:master Jul 26, 2023
28 checks passed
jagan-parthiban pushed a commit to jagan-parthiban/trafficcontrol that referenced this pull request Jul 27, 2023
* adding check to verify rpmdb

* added check to verify rpm db

* rebase and fix conflicts

* if rpmdb is unhealthy use package data in metadata

* requested changes addressed.

* added changelog entry

* fixed spelling error and added GoDoc commnet

* fixed formatting error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended cache-config Cache config generation low impact affects only a small portion of a CDN, and cannot itself break one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants