diff --git a/pkg/kine/logstructured/logstructured.go b/pkg/kine/logstructured/logstructured.go index 32dd29c..a5108f0 100644 --- a/pkg/kine/logstructured/logstructured.go +++ b/pkg/kine/logstructured/logstructured.go @@ -81,9 +81,8 @@ func (l *LogStructured) Get(ctx context.Context, key, rangeEnd string, limit, re attribute.Int64("revision", revision), ) defer func() { - l.adjustRevision(ctx, &revRet) logrus.Debugf("GET %s, rev=%d => rev=%d, kv=%v, err=%v", key, revision, revRet, kvRet != nil, errRet) - span.SetAttributes(attribute.Int64("adjusted-revision", revRet)) + span.SetAttributes(attribute.Int64("current-revision", revRet)) span.RecordError(errRet) span.End() }() @@ -114,8 +113,7 @@ func (l *LogStructured) get(ctx context.Context, key, rangeEnd string, limit, re span.AddEvent("key already compacted") // ignore compacted when getting by revision err = nil - } - if err != nil { + } else if err != nil { return 0, nil, err } if revision != 0 { @@ -127,16 +125,6 @@ func (l *LogStructured) get(ctx context.Context, key, rangeEnd string, limit, re return rev, events[0], nil } -func (l *LogStructured) adjustRevision(ctx context.Context, rev *int64) { - if *rev != 0 { - return - } - - if newRev, err := l.log.CurrentRevision(ctx); err == nil { - *rev = newRev - } -} - func (l *LogStructured) Create(ctx context.Context, key string, value []byte, lease int64) (rev int64, created bool, err error) { rev, created, err = l.log.Create(ctx, key, value, lease) logrus.Debugf("CREATE %s, size=%d, lease=%d => rev=%d, err=%v", key, len(value), lease, rev, err) @@ -184,7 +172,7 @@ func (l *LogStructured) Count(ctx context.Context, prefix, startKey string, revi attribute.String("prefix", prefix), attribute.String("startKey", startKey), attribute.Int64("revision", revision), - attribute.Int64("adjusted-revision", revRet), + attribute.Int64("current-revision", revRet), attribute.Int64("count", count), ) span.RecordError(err) @@ -202,7 +190,7 @@ func (l *LogStructured) Update(ctx context.Context, key string, value []byte, re attribute.Int64("revision", revision), attribute.Int64("lease", lease), attribute.Int64("value-size", int64(len(value))), - attribute.Int64("adjusted-revision", revRet), + attribute.Int64("current-revision", revRet), attribute.Bool("updated", updateRet), ) span.End() diff --git a/pkg/kine/logstructured/sqllog/sql.go b/pkg/kine/logstructured/sqllog/sql.go index 89d707b..af9ad6c 100644 --- a/pkg/kine/logstructured/sqllog/sql.go +++ b/pkg/kine/logstructured/sqllog/sql.go @@ -260,12 +260,6 @@ func (s *SQLLog) List(ctx context.Context, prefix, startKey string, limit, revis return 0, nil, err } - if revision > 0 && revision < compactRevision { - return currentRevision, result, server.ErrCompacted - } - - s.notifyWatcherPoll(currentRevision) - return currentRevision, result, err }