Skip to content

Commit ffb52cc

Browse files
committed
feat: NOTICKET - Remove FSync
1 parent 927ca66 commit ffb52cc

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

internal/legacy/connstring/connstring.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ type ConnString struct {
3737
Connect ConnectMode
3838
ConnectTimeout time.Duration
3939
Database string
40-
FSync bool
4140
HeartbeatInterval time.Duration
4241
Hosts []string
4342
Journal bool
@@ -346,12 +345,6 @@ func (p *parser) addOption(pair string) error {
346345
return fmt.Errorf("invalid value for %s: %s", key, value)
347346
}
348347
p.HeartbeatInterval = time.Duration(n) * time.Millisecond
349-
case "fsync":
350-
f, err := strconv.ParseBool(value)
351-
if err != nil {
352-
return fmt.Errorf("invalid value for %s: %s", key, value)
353-
}
354-
p.FSync = f
355348
case "j":
356349
j, err := strconv.ParseBool(value)
357350
if err != nil {

internal/legacy/options/options.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ type WriteConcern struct {
165165

166166
w int
167167
wtimeout int
168-
fsync bool
169168
journal bool
170169
}
171170

internal/llmgo/session.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ type getLastError struct {
107107
CmdName int "getLastError,omitempty"
108108
W interface{} "w,omitempty"
109109
WTimeout int "wtimeout,omitempty"
110-
FSync bool "fsync,omitempty"
111110
J bool "j,omitempty"
112111
}
113112

@@ -1811,7 +1810,7 @@ func (s *Session) Safe() (safe *Safe) {
18111810
defer s.m.Unlock()
18121811
if s.safeOp != nil {
18131812
cmd := s.safeOp.Query.(*getLastError)
1814-
safe = &Safe{WTimeout: cmd.WTimeout, FSync: cmd.FSync, J: cmd.J}
1813+
safe = &Safe{WTimeout: cmd.WTimeout, J: cmd.J}
18151814
switch w := cmd.W.(type) {
18161815
case string:
18171816
safe.WMode = w
@@ -1946,7 +1945,7 @@ func (s *Session) ensureSafe(safe *Safe) {
19461945

19471946
var cmd getLastError
19481947
if s.safeOp == nil {
1949-
cmd = getLastError{1, w, safe.WTimeout, safe.FSync, safe.J}
1948+
cmd = getLastError{1, w, safe.WTimeout, safe.J}
19501949
} else {
19511950
// Copy. We don't want to mutate the existing query.
19521951
cmd = *(s.safeOp.Query.(*getLastError))
@@ -1960,10 +1959,7 @@ func (s *Session) ensureSafe(safe *Safe) {
19601959
if safe.WTimeout > 0 && safe.WTimeout < cmd.WTimeout {
19611960
cmd.WTimeout = safe.WTimeout
19621961
}
1963-
if safe.FSync {
1964-
cmd.FSync = true
1965-
cmd.J = false
1966-
} else if safe.J && !cmd.FSync {
1962+
if safe.J {
19671963
cmd.J = true
19681964
}
19691965
}
@@ -4469,6 +4465,7 @@ func (c *Collection) writeOpCommand(socket *MongoSocket, safeOp *QueryOp, op int
44694465
} else {
44704466
writeConcern = safeOp.Query.(*getLastError)
44714467
}
4468+
debugf("writeConcern is %+v", writeConcern)
44724469

44734470
var cmd bson.D
44744471
switch op := op.(type) {

0 commit comments

Comments
 (0)