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

Reading an uncommitted block which has been deleted from buffer cache #1503

Merged
merged 7 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Bug Fixes**
- Flush shall only sync the blocks to storage and not delete them from local cache.
- Random write has been re-enabled in block cache.
- Writing to an uncommitted block which has been deleted from the in-memory cache.
- Reading or writing to an uncommitted block which has been deleted from the in-memory cache.
- Check download status of a block before updating and return error if it failed to download.

## 2.3.1 (Unreleased)
Expand Down
4 changes: 2 additions & 2 deletions azure-pipeline-templates/verbose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ steps:
distro_name: ${{ parameters.distro_name }}
quick_test: false
verbose_log: ${{ parameters.verbose_log }}
clone: true
clone: false

- ${{ if eq(parameters.test_sas_credential, true) }}:
- template: e2e-tests.yml
Expand Down Expand Up @@ -385,4 +385,4 @@ steps:
${{ parameters.working_dir }}/blobfuse2 mount ${{ parameters.mount_dir }} --config-file=${{ parameters.config }}
--default-working-dir=${{ parameters.working_dir }}
displayName: 'HugeList: Mount'
continueOnError: false
continueOnError: false
2 changes: 1 addition & 1 deletion cmd/health-monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func validateHMonOptions() error {
}

if len(errMsg) != 0 {
return fmt.Errorf(errMsg)
return fmt.Errorf("%s", errMsg)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,5 +754,5 @@ func init() {

func Destroy(message string) error {
_ = log.Destroy()
return fmt.Errorf(message)
return fmt.Errorf("%s", message)
}
2 changes: 1 addition & 1 deletion component/azstorage/azauthmsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (azmsi *azAuthMSI) getTokenCredentialUsingCLI() (azcore.TokenCredential, er
if msg == "" {
msg = err.Error()
}
return nil, fmt.Errorf(msg)
return nil, fmt.Errorf("%s", msg)
}

log.Info("azAuthMSI::getTokenCredentialUsingCLI : Successfully logged in using Azure CLI")
Expand Down
12 changes: 10 additions & 2 deletions component/block_cache/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ const (
BlockFlagFailed // Block upload/download has failed
)

// Flags to denote the status of upload/download of a block
const (
BlockStatusDownloaded int = iota + 1 // Download of this block is complete
BlockStatusUploaded // Upload of this block is complete
BlockStatusDownloadFailed // Download of this block has failed
BlockStatusUploadFailed // Upload of this block has failed
)

// Block is a memory mapped buffer with its state to hold data
type Block struct {
offset uint64 // Start offset of the data this block holds
Expand Down Expand Up @@ -127,9 +135,9 @@ func (b *Block) Uploading() {
}

// Ready marks this Block is now ready for reading by its first reader (data download completed)
func (b *Block) Ready() {
func (b *Block) Ready(val int) {
select {
case b.state <- 1:
case b.state <- val:
break
default:
break
Expand Down
Loading