Documentation ¶
Index ¶
- func BulkOpResponseFilter(allowProgressIota *chan struct{}) kvserverbase.ReplicaResponseFilter
- func GetJobFormatVersion(t testing.TB, db *sqlutils.SQLRunner) jobspb.SchemaChangeDetailsFormatVersion
- func GetJobID(t testing.TB, db *sqlutils.SQLRunner, offset int) int64
- func GetJobProgress(t *testing.T, db *sqlutils.SQLRunner, jobID int64) *jobspb.Progress
- func GetLastJobID(t testing.TB, db *sqlutils.SQLRunner) int64
- func RunJob(t *testing.T, db *sqlutils.SQLRunner, allowProgressIota *chan struct{}, ...) (int64, error)
- func VerifyRunningSystemJob(t testing.TB, db *sqlutils.SQLRunner, offset int, filterType jobspb.Type, ...) error
- func VerifySystemJob(t testing.TB, db *sqlutils.SQLRunner, offset int, filterType jobspb.Type, ...) error
- func WaitForJob(t testing.TB, db *sqlutils.SQLRunner, jobID int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BulkOpResponseFilter ¶
func BulkOpResponseFilter(allowProgressIota *chan struct{}) kvserverbase.ReplicaResponseFilter
BulkOpResponseFilter creates a blocking response filter for the responses related to bulk IO/backup/restore/import: Export, Import and AddSSTable. See discussion on RunJob for where this might be useful.
func GetJobFormatVersion ¶
func GetJobFormatVersion( t testing.TB, db *sqlutils.SQLRunner, ) jobspb.SchemaChangeDetailsFormatVersion
GetJobFormatVersion returns the format version of a schema change job. Will fail the test if the jobID does not reference a schema change job.
func GetJobProgress ¶
GetJobProgress loads the Progress message associated with the job.
func GetLastJobID ¶
GetLastJobID gets the most recent job's ID.
func RunJob ¶
func RunJob( t *testing.T, db *sqlutils.SQLRunner, allowProgressIota *chan struct{}, ops []string, query string, args ...interface{}, ) (int64, error)
RunJob runs the provided job control statement, intializing, notifying and closing the chan at the passed pointer (see below for why) and returning the jobID and error result. PAUSE JOB and CANCEL JOB are racy in that it's hard to guarantee that the job is still running when executing a PAUSE or CANCEL--or that the job has even started running. To synchronize, we can install a store response filter which does a blocking receive for one of the responses used by our job (for example, Export for a BACKUP). Later, when we want to guarantee the job is in progress, we do exactly one blocking send. When this send completes, we know the job has started, as we've seen one expected response. We also know the job has not finished, because we're blocking all future responses until we close the channel, and our operation is large enough that it will generate more than one of the expected response.
func VerifyRunningSystemJob ¶
func VerifyRunningSystemJob( t testing.TB, db *sqlutils.SQLRunner, offset int, filterType jobspb.Type, expectedRunningStatus jobs.RunningStatus, expected jobs.Record, ) error
VerifyRunningSystemJob checks that job records are created as expected and is marked as running.
Types ¶
This section is empty.