File tree 3 files changed +19
-1
lines changed
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 {
211
211
res .GroupLeader = sockstat .GetBool (parts [1 ])
212
212
case "is_importing" :
213
213
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 ])
214
218
}
215
219
}
216
220
Original file line number Diff line number Diff line change @@ -76,6 +76,12 @@ type updateData struct {
76
76
CommandID string `json:"command_id,omitempty"`
77
77
// IsImporting is true if the command is an import.
78
78
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:"is_importing,omitempty"`
82
+ // IsImportSoftThrottling is true if the command is an import and
83
+ // want to apply it some soft throttling policies.
84
+ ImportSoftThrottling bool `json:"is_importing,omitempty"`
79
85
}
80
86
81
87
func 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 {
955
955
}
956
956
957
957
func (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 () || shouldSkipPushLimit () {
959
963
return 80 * 1024 * 1024 * 1024 , nil /* 80 GB */
960
964
}
961
965
@@ -1234,6 +1238,10 @@ func isImporting() bool {
1234
1238
return sockstat .GetBool ("is_importing" )
1235
1239
}
1236
1240
1241
+ func shouldSkipPushLimit () bool {
1242
+ return sockstat .GetBool ("import_skip_push_limit" )
1243
+ }
1244
+
1237
1245
func allowBadDate () bool {
1238
1246
return isImporting () && sockstat .GetBool ("allow_baddate_in_import" )
1239
1247
}
You can’t perform that action at this time.
0 commit comments