func (e ShardError) Error() string {
	return fmt.Sprintf("[shard %d] %s", e.id, e.Err)
}
Error returns the string representation of the error, to satisfy the error interface.
package tsdb
import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"regexp"
	"runtime"
	"sort"
	"strings"
	"sync"
	"sync/atomic"
	"time"
	"github.com/gogo/protobuf/proto"
	"github.com/influxdata/influxdb/models"
	"github.com/influxdata/influxdb/pkg/bytesutil"
	"github.com/influxdata/influxdb/pkg/estimator"
	"github.com/influxdata/influxdb/pkg/file"
	"github.com/influxdata/influxdb/pkg/limiter"
	"github.com/influxdata/influxdb/query"
	internal "github.com/influxdata/influxdb/tsdb/internal"
	"github.com/influxdata/influxql"
	"go.uber.org/zap"
)
const (
	statWriteReq           = "writeReq"
	statWriteReqOK         = "writeReqOk"
	statWriteReqErr        = "writeReqErr"
	statSeriesCreate       = "seriesCreate"
	statFieldsCreate       = "fieldsCreate"
	statWritePointsErr     = "writePointsErr"
	statWritePointsDropped = "writePointsDropped"
	statWritePointsOK      = "writePointsOk"
	statWriteBytes         = "writeBytes"
	statDiskBytes          = "diskBytes"
)
var (
	ErrFieldOverflow = errors.New("field overflow")
	ErrFieldTypeConflict = errors.New("field type conflict")
	ErrFieldNotFound = errors.New("field not found")
	ErrFieldUnmappedID = errors.New("field ID not mapped")
	ErrEngineClosed = errors.New("engine is closed")
	ErrShardDisabled = errors.New("shard is disabled")
	ErrUnknownFieldsFormat = errors.New("unknown field index format")
	ErrShardNotIdle = errors.New("shard not idle")
	fieldsIndexMagicNumber = []byte{0, 6, 1, 3}
)
var (
	timeBytes = []byte("time")
)
type ShardError struct {
	id  uint64
	Err error
}
func NewShardError(id uint64, err error) error {
	if err == nil {
		return nil
	}
	return ShardError{id: id, Err: err}
}