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

Add Raw Import and Raw Batch for Writing to SS in any order of version #68

Merged
merged 6 commits into from
Jul 15, 2024

Conversation

Kbhat1
Copy link
Contributor

@Kbhat1 Kbhat1 commented Jul 2, 2024

Describe your changes and provide context

  • For archive node migration, adds RawImport and RawBatch which allows importing in kv entries in any order of version

Testing performed to validate your change

  • Added unit tests for both RawImport and Import
  • Tested on node (re routed Import to use RawImport), verifying on new cluster

@Kbhat1 Kbhat1 changed the title Add Raw Import and Raw Batch for Writing to SS in any order of versoin Add Raw Import and Raw Batch for Writing to SS in any order of version Jul 2, 2024
Comment on lines 501 to 506
go func() {
defer close(rawCh)
for entry := range ch {
rawCh <- types.GetRawSnapshotNode(entry, version)
}
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism

wg.Add(db.config.ImportNumWorkers)
for i := 0; i < db.config.ImportNumWorkers; i++ {
go worker()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
@Kbhat1 Kbhat1 requested a review from yzang2019 July 15, 2024 13:49
Comment on lines +1202 to +1211
go func() {
for i := 0; i < 10; i++ {
ch <- types.SnapshotNode{
StoreKey: "store1",
Key: []byte(fmt.Sprintf("key%03d", i)),
Value: []byte(fmt.Sprintf("value%03d", i)),
}
}
close(ch)
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note test

Spawning a Go routine may be a possible source of non-determinism
Comment on lines 1233 to 1241
go func(i int) {
defer wg.Done() // Decrement the counter when the goroutine completes
ch <- types.RawSnapshotNode{
StoreKey: "store1",
Key: []byte(fmt.Sprintf("key%03d", i)),
Value: []byte(fmt.Sprintf("value%03d", i)),
Version: int64(i + 1),
}
}(i)

Check notice

Code scanning / CodeQL

Spawning a Go routine Note test

Spawning a Go routine may be a possible source of non-determinism
Comment on lines +1244 to +1247
go func() {
wg.Wait()
close(ch)
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note test

Spawning a Go routine may be a possible source of non-determinism
Comment on lines +1233 to +1241
go func(i int) {
defer wg.Done()
ch <- types.RawSnapshotNode{
StoreKey: "store1",
Key: []byte(fmt.Sprintf("key%03d", i)),
Value: []byte(fmt.Sprintf("value%03d", i)),
Version: int64(i + 1),
}
}(i)

Check notice

Code scanning / CodeQL

Spawning a Go routine Note test

Spawning a Go routine may be a possible source of non-determinism
Comment on lines +1244 to +1247
go func() {
wg.Wait()
close(ch)
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note test

Spawning a Go routine may be a possible source of non-determinism
@Kbhat1 Kbhat1 merged commit 5611081 into main Jul 15, 2024
4 of 5 checks passed
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.

2 participants