Compare commits

...

4 Commits
v8.2 ... r8.2.3

Author SHA1 Message Date
Spencer Jackson
029d8f99bf SERVER-115494: [v8.2.3] Fix for SERVER-115508 (#45265)
GitOrigin-RevId: 36f41c9c30a2f13f834d033ba03c3463c891fb01
2025-12-22 19:32:49 +00:00
Zack Winter
864c77d58a SERVER-113700 [v8.2] Update copybara to v20251110 (#43804) (#44162)
Co-authored-by: Udita <83602637+ubatmongo@users.noreply.github.com>
GitOrigin-RevId: 24688a07265261030c48ccde66dd86eeb49717fe
2025-12-22 19:32:31 +00:00
Zack Winter
c465f3b8ac SERVER-113431 Pin copybara to a specific tag (#43548) (#43549)
GitOrigin-RevId: 21b8f9cfbac84c27ad27450c15e954153e20a80b
2025-12-22 19:32:13 +00:00
Andrew Bradshaw
3148ef847e SERVER-108208 Update debian 10 urls when testing packages (#39146) (#44267)
GitOrigin-RevId: 7b237ee4a26fb5dfbfec5ecb9c8c9a8bf504da96
2025-12-22 19:31:53 +00:00
4 changed files with 74 additions and 2 deletions

View File

@@ -360,7 +360,7 @@ def run_test(test: Test, client: DockerClient) -> Result:
"yum -y install yum-utils epel-release",
"yum-config-manager --enable epel",
]
if test.os_name.startswith("debian92"):
if test.os_name.startswith("debian92") or test.os_name.startswith("debian10"):
# Adapted from https://stackoverflow.com/questions/76094428/debian-stretch-repositories-404-not-found
# Debian92 renamed its repos to archive
# The first two sed commands are to replace debian92's sources list to archive repo

View File

@@ -17,6 +17,9 @@ from github import GithubIntegration
from buildscripts.util.read_config import read_config_file
from evergreen.api import RetryingEvergreenApi
# Commit hash of Copybara to use (v20251110)
COPYBARA_COMMIT_HASH = "3f050c9e08b84aeda98875bf1b02a3288d351333"
class CopybaraRepoConfig(NamedTuple):
"""Copybara source and destination repo sync configuration."""
@@ -386,6 +389,9 @@ def main():
else:
run_command("git clone https://github.com/10gen/copybara.git")
# Checkout the specific commit of Copybara we want to use
run_command(f"cd copybara && git checkout {COPYBARA_COMMIT_HASH}")
# Navigate to the Copybara directory and build the Copybara Docker image
run_command("cd copybara && docker build --rm -t copybara .")

View File

@@ -189,6 +189,26 @@ void checkOverflow(std::unique_ptr<MessageCompressorBase> compressor) {
compressor->decompressData(tooSmallRange, DataRange(scratch.data(), scratch.size())));
}
void checkUndersize(const Message& compressedMsg,
std::unique_ptr<MessageCompressorBase> compressor) {
MessageCompressorRegistry registry;
const auto compressorName = compressor->getName();
std::vector<std::string> compressorList = {compressorName};
registry.setSupportedCompressors(std::move(compressorList));
registry.registerImplementation(std::move(compressor));
registry.finalizeSupportedCompressors().transitional_ignore();
MessageCompressorManager mgr(&registry);
BSONObjBuilder negotiatorOut;
std::vector<StringData> negotiator({compressorName});
mgr.serverNegotiate(negotiator, &negotiatorOut);
checkNegotiationResult(negotiatorOut.done(), {compressorName});
auto swm = mgr.decompressMessage(compressedMsg);
ASSERT_EQ(ErrorCodes::BadValue, swm.getStatus());
}
Message buildMessage() {
const auto data = std::string{"Hello, world!"};
const auto bufferSize = MsgData::MsgDataHeaderSize + data.size();
@@ -294,6 +314,52 @@ TEST(ZstdMessageCompressor, Overflow) {
checkOverflow(std::make_unique<ZstdMessageCompressor>());
}
TEST(ZlibMessageCompressor, Mismatch) {
checkOverflow(std::make_unique<ZlibMessageCompressor>());
}
TEST(SnappyMessageCompressor, Undersize) {
std::vector<std::uint8_t> payload = {
0x41, 0x0, 0x0, 0x0, 0xad, 0xde, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdc,
0x7, 0x0, 0x0, 0xdd, 0x7, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x1, 0x27,
0x0, 0x0, 0x1, 0x1, 0x84, 0xfb, 0x1f, 0x0, 0x0, 0x5, 0x5f, 0x69, 0x64,
0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x48, 0x45, 0x41, 0x50, 0x4c, 0x45, 0x41,
0x4b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
auto buffer = SharedBuffer::allocate(payload.size());
std::copy(payload.begin(), payload.end(), buffer.get());
checkUndersize(Message(buffer), std::make_unique<SnappyMessageCompressor>());
}
TEST(ZlibMessageCompressor, Undersize) {
std::vector<std::uint8_t> payload = {
0x3c, 0x00, 0x00, 0x00, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x07, 0x00,
0x00, 0xdd, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x78, 0xda, 0x63, 0x60, 0x00,
0x82, 0xdf, 0xf2, 0x0c, 0x0c, 0xac, 0xf1, 0x99, 0x29, 0x0c, 0x0c, 0x02, 0x40, 0x9e, 0x87,
0xab, 0x63, 0x80, 0x8f, 0xab, 0xa3, 0x37, 0x03, 0x12, 0x00, 0x00, 0x6d, 0x26, 0x04, 0x97};
auto buffer = SharedBuffer::allocate(payload.size());
std::copy(payload.begin(), payload.end(), buffer.get());
checkUndersize(Message(buffer), std::make_unique<ZlibMessageCompressor>());
}
TEST(ZstdMessageCompressor, Undersize) {
std::vector<std::uint8_t> payload = {
0x44, 0x0, 0x0, 0x0, 0xad, 0xde, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdc, 0x7,
0x0, 0x0, 0xdd, 0x7, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x3, 0x28, 0xb5, 0x2f,
0xfd, 0x20, 0x27, 0x15, 0x1, 0x0, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfb, 0x1f,
0x0, 0x0, 0x5, 0x5f, 0x69, 0x64, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x48, 0x45,
0x41, 0x50, 0x4c, 0x45, 0x41, 0x4b, 0x0, 0x1, 0x0, 0x18, 0xc0, 0x9};
auto buffer = SharedBuffer::allocate(payload.size());
std::copy(payload.begin(), payload.end(), buffer.get());
checkUndersize(Message(buffer), std::make_unique<ZstdMessageCompressor>());
}
TEST(MessageCompressorManager, SERVER_28008) {
// Create a client and server that will negotiate the same compressors,

View File

@@ -80,7 +80,7 @@ StatusWith<std::size_t> ZlibMessageCompressor::decompressData(ConstDataRange inp
}
counterHitDecompress(input.length(), output.length());
return {output.length()};
return {length};
}