github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/kv/kvserver/closedts/minprop/doc.go (about) 1 // Copyright 2018 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 // Package minprop exports a main data structure, Tracker, which checkpoints 12 // closed timestamps and associated Raft Lease Applied indexes positions for 13 // which (under additional conditions) it is legal to serve follower reads. It 14 // does so by maintaining a 'next' timestamp above which new command evaluations 15 // are forced, and by tracking when all in-flight evaluations below this 16 // timestamp have completed (at which point a call to the Close method succeeds: 17 // 'next' becomes closed, and a new 'next' is initialized with a future 18 // timestamp). 19 // 20 // In-flight command evaluations are tracked via the Track method which acquires 21 // a reference with the tracker, returns a minimum timestamp to be used for the 22 // proposal evaluation, and provides a closure that releases the reference with 23 // a lease applied index used for the proposal. 24 package minprop