go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/server/tq/internal/tqpb/tasks.proto (about)

     1  // Copyright 2020 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package luci.server.tq.internal;
    18  
    19  option go_package = "go.chromium.org/luci/server/tq/internal/tqpb";
    20  
    21  // SweepTask is used to distribute sweeping work items and options when doing
    22  // distributed sweeps.
    23  //
    24  // All fields are required.
    25  message SweepTask {
    26    // DB is an identifier of the database used for reminders.
    27    //
    28    // It must be registered in the process that does the sweeping.
    29    string db = 1;
    30  
    31    // Partition specifies the range of keys to scan as [Low..High).
    32    //
    33    // It is a string of the form "<hex-low>_<hex-high>".
    34    string partition = 2;
    35  
    36    // Identifies a registered Lessor implementation to grab leases through.
    37    string lessor_id = 3;
    38  
    39    // Identifier of a lease section ID to grab leases on sub-partitions through.
    40    string lease_section_id = 4;
    41  
    42    // Total number of shards used when this task was generated.
    43    //
    44    // Used FYI only in logs.
    45    int32 shard_count = 5;
    46  
    47    // Shard number in the range of [0 .. Shards).
    48    //
    49    // Used FYI only in logs.
    50    int32 shard_index = 6;
    51  
    52    // Level counts recursion level for monitoring/debugging purposes.
    53    //
    54    // The root sweeper triggers tasks at level=0. If there is a big backlog,
    55    // level=0 task will offload some work to level=1 tasks. level > 1 should not
    56    // normally happen and indicates either a bug or a very overloaded system.
    57    //
    58    // level > 2 won't be executed at all.
    59    int32 level = 7;
    60  
    61    // Length of the reminder keys in the partition.
    62    //
    63    // Used to figure out the upper bound of the scan. Usually 16.
    64    int32 key_space_bytes = 8;
    65  
    66    // Caps maximum number of reminders to process.
    67    //
    68    // Usually in hundreds.
    69    int32 tasks_per_scan = 9;
    70  
    71    // Caps the number of follow-up scans.
    72    //
    73    // Usually 16.
    74    int32 secondary_scan_shards = 10;
    75  }