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

change(ci): Label cached state disks with the disk they were updated from #7557

Closed
wants to merge 1 commit into from

Conversation

teor2345
Copy link
Contributor

Motivation

When we're tracking down CI cached state issues, it's helpful to know which disks (and git branches) have updated a cached state.

We almost needed this for bug #7532, but that bug happened with a newly created full sync state.

Solution

  • add a label with the original disk name
  • log the original disk name

Review

This is important because we might need it to fix similar state bugs soon.

Reviewer Checklist

  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

@teor2345 teor2345 added A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement P-Medium ⚡ A-diagnostics Area: Diagnosing issues or monitoring performance A-state Area: State / database changes C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG labels Sep 14, 2023
@teor2345 teor2345 requested a review from a team as a code owner September 14, 2023 01:17
@teor2345 teor2345 self-assigned this Sep 14, 2023
@teor2345 teor2345 requested review from gustavovalverde and removed request for a team September 14, 2023 01:17
@@ -901,9 +908,9 @@ jobs:
--source-disk-zone=${{ vars.GCP_ZONE }} \
--storage-location=us \
--description="Created from commit ${{ env.GITHUB_SHA_SHORT }} with height ${{ env.SYNC_HEIGHT }} and database format ${{ env.DB_VERSION_SUMMARY }}" \
--labels="height=${{ env.SYNC_HEIGHT }},purpose=${{ inputs.disk_prefix }},commit=${{ env.GITHUB_SHA_SHORT }},state-version=${{ env.STATE_VERSION }},state-running-version=${RUNNING_DB_VERSION},initial-state-disk-version=${INITIAL_DISK_DB_VERSION},network=${NETWORK},target-height-kind=${{ inputs.disk_suffix }},update-flag=${UPDATE_SUFFIX},force-save=${{ inputs.force_save_to_disk }},updated-from-height=${ORIGINAL_HEIGHT},test-id=${{ inputs.test_id }},app-name=${{ inputs.app_name }}"
--labels="height=${{ env.SYNC_HEIGHT }},purpose=${{ inputs.disk_prefix }},commit=${{ env.GITHUB_SHA_SHORT }},state-version=${{ env.STATE_VERSION }},state-running-version=${RUNNING_DB_VERSION},initial-state-disk-version=${INITIAL_DISK_DB_VERSION},network=${NETWORK},target-height-kind=${{ inputs.disk_suffix }},update-flag=${UPDATE_SUFFIX},force-save=${{ inputs.force_save_to_disk }},updated-from-height=${ORIGINAL_HEIGHT},updated-from-disk=${ORIGINAL_DISK_NAME},test-id=${{ inputs.test_id }},app-name=${{ inputs.app_name }}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To test these changes, I need to run CI on this branch, and force it to save a disk with the new label:
https://github.com/ZcashFoundation/zebra/actions/runs/6179715964

Screenshot

Testing

The disks created by that action run must have an updated-from-disk label.
The "Get original cached state height from google cloud" step should log the disk name and height correctly.

@teor2345 teor2345 closed this Sep 14, 2023
@teor2345 teor2345 deleted the label-cached-state-from-disk branch September 14, 2023 02:39
@teor2345
Copy link
Contributor Author

I had to close this PR and open it with a shorter branch name due to bug #7559

@mergify
Copy link
Contributor

mergify bot commented Sep 14, 2023

⚠️ The sha of the head commit of this PR conflicts with #7560. Mergify cannot evaluate rules on this PR. ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-devops Area: Pipelines, CI/CD and Dockerfiles A-diagnostics Area: Diagnosing issues or monitoring performance A-state Area: State / database changes C-enhancement Category: This is an improvement C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant