File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,10 @@ func readSockstat(environ []string) updateData {
211211 res .GroupLeader = sockstat .GetBool (parts [1 ])
212212 case "is_importing" :
213213 res .IsImporting = sockstat .BoolValue (parts [1 ])
214+ case "import_skip_push_limit" :
215+ res .ImportSkipPushLimit = sockstat .BoolValue (parts [1 ])
216+ case "import_soft_throttling" :
217+ res .ImportSoftThrottling = sockstat .BoolValue (parts [1 ])
214218 }
215219 }
216220
Original file line number Diff line number Diff line change @@ -76,6 +76,12 @@ type updateData struct {
7676 CommandID string `json:"command_id,omitempty"`
7777 // IsImporting is true if the command is an import.
7878 IsImporting bool `json:"is_importing,omitempty"`
79+ // ImportSkipPushLimit is true if the command is an import and
80+ // want to skip the push limit for a command.
81+ ImportSkipPushLimit bool `json:"import_skip_push_limit,omitempty"`
82+ // ImportSoftThrottling is true if the command is an import and
83+ // want to apply it some soft throttling policies.
84+ ImportSoftThrottling bool `json:"import_soft_throttling,omitempty"`
7985}
8086
8187func update (w io.Writer , ud updateData ) error {
Original file line number Diff line number Diff line change @@ -955,7 +955,11 @@ func (r *spokesReceivePack) isFsckConfigEnabled() bool {
955955}
956956
957957func (r * spokesReceivePack ) getMaxInputSize () (int , error ) {
958- if isImporting () {
958+ // We want to skip the default push limit when the `import_skip_push_limit`
959+ // stat is set only.
960+ // We keep using the `is_import` here for backward compatibility only,
961+ // which should be removed on a subsequent PR.
962+ if isImporting () || skipPushLimit () {
959963 return 80 * 1024 * 1024 * 1024 , nil /* 80 GB */
960964 }
961965
@@ -1234,6 +1238,10 @@ func isImporting() bool {
12341238 return sockstat .GetBool ("is_importing" )
12351239}
12361240
1241+ func skipPushLimit () bool {
1242+ return sockstat .GetBool ("import_skip_push_limit" )
1243+ }
1244+
12371245func allowBadDate () bool {
12381246 return isImporting () && sockstat .GetBool ("allow_baddate_in_import" )
12391247}
You can’t perform that action at this time.
0 commit comments