Update function naming and docstring
@@ -1319,20 +1319,19 @@ func RequireStableFetchOffsets() GroupOpt {
return groupOpt{func(cfg *cfg) { cfg.requireStable = true }}
}
-// AdjustOffsetsBeforeAssign sets the function to be called when a group is joined
+// AdjustFetchOffsetsFn sets the function to be called when a group is joined
// after offsets are fetched for those partitions so that a user can adjust them
// before consumption begins.
//
-// This function combined with OnPartitionsRevoked should not exceed the
-// rebalance interval. It is possible for the group, immediately after
-// finishing a balance, to re-enter a new balancing session.
+// This function combined should not exceed the rebalance interval. It is possible
+// for the group, immediately after finishing a balance, to re-enter a new balancing
+// session. This function is passed a context that is canceled if the current group
+// session finishes (i.e., after revoking).
//
-// The AdjustOffsetsBeforeAssign function is passed the client's context, which is
-// only canceled if the client is closed.
-//
-// This function is not called concurrent with any other On callback, and this
-// function is given a new map that the user is free to modify.
-func AdjustOffsetsBeforeAssign(adjustOffsetsBeforeAssign func(context.Context, map[string]map[int32]Offset) (map[string]map[int32]Offset, error)) GroupOpt {
+// If you are resetting the position of the offset, you may want to clear any existing
+// "epoch" with WithEpoch(-1). If the epoch is non-negative, the client performs
+// data loss detection, which may result in errors and unexpected consuming offsets.
+func AdjustFetchOffsetsFn(adjustOffsetsBeforeAssign func(context.Context, map[string]map[int32]Offset) (map[string]map[int32]Offset, error)) GroupOpt {
return groupOpt{func(cfg *cfg) { cfg.adjustOffsetsBeforeAssign = adjustOffsetsBeforeAssign }}
}
