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

fix: lock attach table's snapshot location #16952

Merged

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Nov 26, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

During instantiating attach table instance, "lock" table's snapshot location( which is extracted from the last_snapshot_hint file), by

  • putting the snapshot location extracted from hint file into table_info's options as the value of opt key OPT_KEY_SNAPSHOT_LOCATION
  • for those table instances that created "from" the above table_info, they will use the same snapshot location

NOTE:

[databend_common_base::runtime::Runtime::block_on] (not tokio's) is used to execute async code within a sync context. It seems to be safe (not blocking other async tasks), but I am not quite sure.

@zhang2014 Please help review this usage.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - use existing tests

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Nov 26, 2024
@dantengsky dantengsky force-pushed the fix-lock-snapshot-loc-of-attach-table branch from 371d2a2 to 79a6bb2 Compare November 26, 2024 17:22
@dantengsky dantengsky marked this pull request as ready for review November 27, 2024 03:06
So that table instances that created from this table_info will not
loading snapshot location from the last snapshot hint file again.
@sundy-li sundy-li added this pull request to the merge queue Nov 27, 2024
Merged via the queue into databendlabs:main with commit d0c9175 Nov 27, 2024
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants