Selaa lähdekoodia

Allow resetting manager to the same offset

Helpful if you just want to update the metadata, or maybe in more async
scenarios.
Evan Huus 8 vuotta sitten
vanhempi
commit
96fa1c8378
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      offset_manager.go

+ 1 - 1
offset_manager.go

@@ -340,7 +340,7 @@ func (pom *partitionOffsetManager) ResetOffset(offset int64, metadata string) {
 	pom.lock.Lock()
 	defer pom.lock.Unlock()
 
-	if offset < pom.offset {
+	if offset <= pom.offset {
 		pom.offset = offset
 		pom.metadata = metadata
 		pom.dirty = true