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

WIP: Sharded DB #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

WIP: Sharded DB #76

wants to merge 2 commits into from

Conversation

Kbhat1
Copy link
Contributor

@Kbhat1 Kbhat1 commented Nov 19, 2024

Describe your changes and provide context

Testing performed to validate your change

Comment on lines +83 to +85
for _, batch := range rb.batches {
size += batch.Len()
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +90 to +92
for _, batch := range rb.batches {
batch.Reset()
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +121 to +130
for _, batch := range rb.batches {
if batch.Count() > 0 {
if commitErr := batch.Commit(defaultWriteOpts); commitErr != nil {
err = errors.Join(err, commitErr)
}
}
if closeErr := batch.Close(); closeErr != nil {
err = errors.Join(err, closeErr)
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
database.streamHandler = streamHandler
go database.writeAsyncInBackground()
db.streamHandler = streamHandler
go db.writeAsyncInBackground()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
Comment on lines +176 to +181
for _, storage := range db.storages {
closeErr := storage.Close()
if err == nil && closeErr != nil {
err = closeErr
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +230 to +235
for _, storage := range db.storages {
err := storage.Set([]byte(earliestVersionKey), ts[:], defaultWriteOpts)
if err != nil {
return err
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +273 to +278
for _, storage := range db.storages {
err := storage.Set([]byte(latestMigratedKeyMetadata), key, defaultWriteOpts)
if err != nil {
return err
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +301 to +306
for _, storage := range db.storages {
err := storage.Set([]byte(latestMigratedModuleMetadata), []byte(module), defaultWriteOpts)
if err != nil {
return err
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant