| 41 | } |
| 42 | |
| 43 | func LiveStoreConsumerGroupID(instanceID string) (string, error) { |
| 44 | match := ingesterIDRegexp.FindStringSubmatch(instanceID) |
| 45 | if len(match) == 0 { |
| 46 | return "", fmt.Errorf("instance ID %s doesn't match regular expression %q", instanceID, ingesterIDRegexp.String()) |
| 47 | } |
| 48 | |
| 49 | // Extract everything before the numeric suffix |
| 50 | prefixEnd := len(instanceID) - len(match[0]) |
| 51 | return instanceID[:prefixEnd], nil |
| 52 | } |
| 53 | |
| 54 | // It retry until Kafka broker is ready |
| 55 | func WaitForKafkaBroker(ctx context.Context, c *kgo.Client, l log.Logger) error { |