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

bugfix: stop-previous flag to remove wasm binary by index_id #808

Closed
wants to merge 20 commits into from

Conversation

0xmovses
Copy link
Contributor

@0xmovses 0xmovses commented Apr 26, 2023

Closes #786

Note that the changes to the plugin side were already merged to master, and then reverted. The changes to the plugin are on this branch, but the diff doesn't show because of the previous merge.

Changelog

• Adds conditional logic based on query param to remove_indexer.
• Adds remove_previous_indexer queries function.
• Adds metrics for new query function.

Testing

  1. Build the new plugin binary cargo build -p forc-index -p fuel-indexer --release --features fuel-core-lib.
  2. Refresh the DB and rebuild test binaries.
  3. Start local fuel-node.
  4. Start the indexer.
  5. Deploy the block explorer ./target/release/forc-index deploy --path examples/block-explorer/explorer-indexer
  6. Run the SQL query select * from index_asset_registry_manifest;
    • Make a mental note of the single wasm binary in the DB. 👀
  7. Make some small change in the lib.rs of the block explorer.
  8. Deploy the block explore with the new flag ./target/release/forc-index deploy --stop-previous --path examples/block-explorer/explorer-indexer
  9. Run the same SQL query select * from index_asset_registry_manifest;

You should see that there is still only one wasm binary with the same index_id of 1. The old one was removed.

@0xmovses 0xmovses added the bug Something isn't working label Apr 26, 2023
@0xmovses 0xmovses self-assigned this Apr 26, 2023
@0xmovses 0xmovses changed the title bugfic: stop-previous to remove by wasm binary version id bugfic: stop-previous to remove wasm binary by version id Apr 26, 2023
@0xmovses 0xmovses changed the title bugfic: stop-previous to remove wasm binary by version id bugfic: stop-previous flag to remove wasm binary by version id Apr 26, 2023
@0xmovses 0xmovses changed the title bugfic: stop-previous flag to remove wasm binary by version id bugfix: stop-previous flag to remove wasm binary by version id Apr 26, 2023
@0xmovses 0xmovses changed the title bugfix: stop-previous flag to remove wasm binary by version id enhancement: stop-previous flag to remove wasm binary by index_id Apr 26, 2023
@0xmovses 0xmovses changed the title enhancement: stop-previous flag to remove wasm binary by index_id bugfix: stop-previous flag to remove wasm binary by index_id Apr 26, 2023
@0xmovses 0xmovses requested review from ra0x3 and deekerno April 26, 2023 23:06
Copy link
Contributor

@ra0x3 ra0x3 left a comment

Choose a reason for hiding this comment

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

Left some feedback. Did not test. Will try that next time.

@rvmelkonian In the mean time, can we update the PR with manual testing steps for when its ready to be tested?

examples/block-explorer/explorer-indexer/src/lib.rs Outdated Show resolved Hide resolved
packages/fuel-indexer-api-server/src/uses.rs Outdated Show resolved Hide resolved
packages/fuel-indexer-api-server/src/uses.rs Outdated Show resolved Hide resolved
packages/fuel-indexer-api-server/src/uses.rs Outdated Show resolved Hide resolved
packages/fuel-indexer-database/postgres/src/lib.rs Outdated Show resolved Hide resolved
packages/fuel-indexer-database/src/queries.rs Outdated Show resolved Hide resolved
@0xmovses 0xmovses requested a review from ra0x3 May 4, 2023 13:44
@0xmovses 0xmovses closed this May 11, 2023
@ra0x3 ra0x3 deleted the hotfix/stop-previous-by-version branch June 2, 2023 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow forc index deploy to automagically stop the current version of the indexer
2 participants