filer: add log_ts_ns to ObjectTransactionResponse

CreateEntry and UpdateEntry return the filer log position stamped under
the path lock; a conditional write through ObjectTransaction had no such
field. Add it as field 4 so callers can order one key's commits the same
way regardless of which RPC applied them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-12-01 12:43:47 -08:00
1 parent 40bb214b3f
commit 7b2f04bb3d
3 files changed
+45 -4

No files matched your search

+3
View File
@@ -416,6 +416,9 @@ message ObjectTransactionResponse {
string error = 1;
FilerError error_code = 2;
optional int32 failed_mutation = 3; // index of the mutation that failed (its condition or its apply); unset when the request-level condition failed
// filer log position stamped under the lock after the last mutation
// committed; 0 when the transaction was refused or failed
int64 log_ts_ns = 4;
}
// PosixLockRange is one advisory byte-range lock. Owner identity is (sid, owner):
+15 -4
View File
@@ -1992,8 +1992,11 @@ type ObjectTransactionResponse struct {
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
ErrorCode FilerError `protobuf:"varint,2,opt,name=error_code,json=errorCode,proto3,enum=filer_pb.FilerError" json:"error_code,omitempty"`
FailedMutation *int32 `protobuf:"varint,3,opt,name=failed_mutation,json=failedMutation,proto3,oneof" json:"failed_mutation,omitempty"` // index of the mutation that failed (its condition or its apply); unset when the request-level condition failed
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
// filer log position stamped under the lock after the last mutation
// committed; 0 when the transaction was refused or failed
LogTsNs int64 `protobuf:"varint,4,opt,name=log_ts_ns,json=logTsNs,proto3" json:"log_ts_ns,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ObjectTransactionResponse) Reset() {
@@ -2047,6 +2050,13 @@ func (x *ObjectTransactionResponse) GetFailedMutation() int32 {
return 0
}
func (x *ObjectTransactionResponse) GetLogTsNs() int64 {
if x != nil {
return x.LogTsNs
}
return 0
}
// PosixLockRange is one advisory byte-range lock. Owner identity is (sid, owner):
// sid is the mount session, owner the FUSE lock owner within it, so owners from
// different mounts never alias. end is inclusive (max uint64 = to EOF); is_flock
@@ -7691,12 +7701,13 @@ const file_filer_proto_rawDesc = "" +
"request_id\x18\t \x01(\tR\trequestId\x12*\n" +
"\x11condition_alt_key\x18\n" +
" \x01(\tR\x0fconditionAltKey\x120\n" +
"\x14condition_prefer_alt\x18\v \x01(\bR\x12conditionPreferAlt\"\xa8\x01\n" +
"\x14condition_prefer_alt\x18\v \x01(\bR\x12conditionPreferAlt\"\xc4\x01\n" +
"\x19ObjectTransactionResponse\x12\x14\n" +
"\x05error\x18\x01 \x01(\tR\x05error\x123\n" +
"\n" +
"error_code\x18\x02 \x01(\x0e2\x14.filer_pb.FilerErrorR\terrorCode\x12,\n" +
"\x0ffailed_mutation\x18\x03 \x01(\x05H\x00R\x0efailedMutation\x88\x01\x01B\x12\n" +
"\x0ffailed_mutation\x18\x03 \x01(\x05H\x00R\x0efailedMutation\x88\x01\x01\x12\x1a\n" +
"\tlog_ts_ns\x18\x04 \x01(\x03R\alogTsNsB\x12\n" +
"\x10_failed_mutation\"\xa1\x01\n" +
"\x0ePosixLockRange\x12\x14\n" +
"\x05start\x18\x01 \x01(\x04R\x05start\x12\x10\n" +
+27
View File
@@ -1768,6 +1768,11 @@ func (m *ObjectTransactionResponse) MarshalToSizedBufferVT(dAtA []byte) (int, er
i -= len(m.unknownFields)
copy(dAtA[i:], m.unknownFields)
}
if m.LogTsNs != 0 {
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LogTsNs))
i--
dAtA[i] = 0x20
}
if m.FailedMutation != nil {
i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.FailedMutation))
i--
@@ -7481,6 +7486,9 @@ func (m *ObjectTransactionResponse) SizeVT() (n int) {
if m.FailedMutation != nil {
n += 1 + protohelpers.SizeOfVarint(uint64(*m.FailedMutation))
}
if m.LogTsNs != 0 {
n += 1 + protohelpers.SizeOfVarint(uint64(m.LogTsNs))
}
n += len(m.unknownFields)
return n
}
@@ -14654,6 +14662,25 @@ func (m *ObjectTransactionResponse) UnmarshalVT(dAtA []byte) error {
}
}
m.FailedMutation = &v
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field LogTsNs", wireType)
}
m.LogTsNs = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.LogTsNs |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := protohelpers.Skip(dAtA[iNdEx:])