反馈人:李冠
问题1:
java mongodb公共库,(datax同步)超慢命令;
解决方案:关于分片集群需要带上分片键,或寻找业务的架构师沟通
超慢命令为:
{
"username": "datax_user",
"ns": "zhcxkj_comprehensive_bi.t_walmart_listing_quality",
"op": "query",
"millis": 542311,
"docsExamined": 1694906,
"keysExamined": 0,
"nreturned": 101,
"ndeleted": 0,
"ninserted": 0,
"nMatched": 0,
"nModified": 0,
"ts": {
"date": 1760387988259
},
"clientIp": "10.17.10.39",
"locks": {
"Global": {
"acquireCount": {
"r": 34162
},
"timeWaitingTicketMicros": {
"r": 421
}
},
"Database": {
"acquireCount": {
"r": 34162
}
},
"Collection": {
"acquireCount": {
"r": 34162
}
}
},
"command": "{ find: "t_walmart_listing_quality", filter: { and: [ {}, { createTime: { gte: "2025-10-13 12:42:40" } } ] }, shardVersion: [ Timestamp(321, 1), ObjectId(6839679ea0b45807f5002aac) ], lsid: { id: UUID("63e79c5a-1c6a-4bee-8f91-47568d915122"), uid: BinData(0, 5D035E05B149CB25204B5CAF3A93FB91CA87AEAB64C1D1B4DC0B47759D3EE42B) }, clusterTime: { clusterTime: Timestamp(1760387445, 8255), signature: { hash: BinData(0, 889B511CF3685982AEEAC0B17BCB4996D1D94C77), keyId: 7527127265109344260 } }, client: { driver: { name: "mongo-java-driver|legacy", version: "3.12.14" }, os: { type: "Linux", name: "Linux", architecture: "amd64", version: "4.18.0-147.5.1.6.h1152.eulerosv2r9.x86_64" }, platform: "Java/Temurin/1.8.0_412-b08", mongos: { host: "host-192-168-61-103:8635", client: "10.17.10.39:34138", version: "4.0.3" }, username: "datax_user" }, configServerState: { opTime: { ts: Timestamp(1760387445, 2837), t: 6 } }, db: "zhcxkj_comprehensive_bi" }",
"original_log": "2025-10-13T20:39:48.259+0000 I COMMAND [conn2986909] command zhcxkj_comprehensive_bi.t_walmart_listing_quality clientIp: 10.17.10.39 username: datax_user command: find { find: "t_walmart_listing_quality", filter: { and: [ {}, { createTime: { gte: "2025-10-13 12:42:40" } } ] }, shardVersion: [ Timestamp(321, 1), ObjectId(6839679ea0b45807f5002aac) ], lsid: { id: UUID("63e79c5a-1c6a-4bee-8f91-47568d915122"), uid: BinData(0, 5D035E05B149CB25204B5CAF3A93FB91CA87AEAB64C1D1B4DC0B47759D3EE42B) }, clusterTime: { clusterTime: Timestamp(1760387445, 8255), signature: { hash: BinData(0, 889B511CF3685982AEEAC0B17BCB4996D1D94C77), keyId: 7527127265109344260 } }, client: { driver: { name: "mongo-java-driver|legacy", version: "3.12.14" }, os: { type: "Linux", name: "Linux", architecture: "amd64", version: "4.18.0-147.5.1.6.h1152.eulerosv2r9.x86_64" }, platform: "Java/Temurin/1.8.0_412-b08", mongos: { host: "host-192-168-61-103:8635", client: "10.17.10.39:34138", version: "4.0.3" }, username: "datax_user" }, configServerState: { opTime: { ts: Timestamp(1760387445, 2837), t: 6 } }, db: "zhcxkj_comprehensive_bi" } planSummary: COLLSCAN cursorid:5721981125112 keysExamined:0 docsExamined:1694906 numYields:34161 nreturned:101 reslen:140041 locks:{ Global: { acquireCount: { r: 34162 }, timeWaitingTicketMicros: { r: 421 } }, Database: { acquireCount: { r: 34162 } }, Collection: { acquireCount: { r: 34162 } } } protocol:op_msg 542311ms"
}

问题2:
java mongodb公共库,(datax同步)超慢命令;
解决方案:关于分片集群需要带上分片键,或寻找业务的架构师沟通
超慢命令为:
{
"username": "datax_user",
"ns": "zhcxkj_comprehensive_bi.t_walmart_listing_quality_source_offer_detail",
"op": "query",
"millis": 202737,
"docsExamined": 2685900,
"keysExamined": 0,
"nreturned": 101,
"ndeleted": 0,
"ninserted": 0,
"nMatched": 0,
"nModified": 0,
"ts": {
"date": 1760387644919
},
"clientIp": "10.17.10.33",
"locks": {
"Global": {
"acquireCount": {
"r": 23062
},
"timeWaitingTicketMicros": {
"r": 418
}
},
"Database": {
"acquireCount": {
"r": 23062
}
},
"Collection": {
"acquireCount": {
"r": 23062
}
}
},
"command": "{ find: "t_walmart_listing_quality_source_offer_detail", filter: { and: [ {}, { or: [ { createTime: { gte: "2025-10-13 12:41:08" } }, { updateTime: { gte: "2025-10-13 12:41:08" } } ] } ] }, shardVersion: [ Timestamp(288, 0), ObjectId(682d86cda0b45807f5312a86) ], lsid: { id: UUID("5d20c00a-9e4e-461f-8902-11be1c3d490b"), uid: BinData(0, 5D035E05B149CB25204B5CAF3A93FB91CA87AEAB64C1D1B4DC0B47759D3EE42B) }, clusterTime: { clusterTime: Timestamp(1760387442, 1741), signature: { hash: BinData(0, 2F662B8142AA9DB7D5146810E504991A3D6DEAD5), keyId: 7527127265109344260 } }, client: { driver: { name: "mongo-java-driver|legacy", version: "3.12.14" }, os: { type: "Linux", name: "Linux", architecture: "amd64", version: "4.18.0-147.5.1.6.h1152.eulerosv2r9.x86_64" }, platform: "Java/Temurin/1.8.0_412-b08", mongos: { host: "host-192-168-63-158:8635", client: "10.17.10.33:38228", version: "4.0.3" }, username: "datax_user" }, configServerState: { opTime: { ts: Timestamp(1760387442, 1365), t: 6 } }, db: "zhcxkj_comprehensive_bi" }",
"original_log": "2025-10-13T20:34:04.919+0000 I COMMAND [conn152791] command zhcxkj_comprehensive_bi.t_walmart_listing_quality_source_offer_detail clientIp: 10.17.10.33 username: datax_user command: find { find: "t_walmart_listing_quality_source_offer_detail", filter: { and: [ {}, { or: [ { createTime: { gte: "2025-10-13 12:41:08" } }, { updateTime: { gte: "2025-10-13 12:41:08" } } ] } ] }, shardVersion: [ Timestamp(288, 0), ObjectId(682d86cda0b45807f5312a86) ], lsid: { id: UUID("5d20c00a-9e4e-461f-8902-11be1c3d490b"), uid: BinData(0, 5D035E05B149CB25204B5CAF3A93FB91CA87AEAB64C1D1B4DC0B47759D3EE42B) }, clusterTime: { clusterTime: Timestamp(1760387442, 1741), signature: { hash: BinData(0, 2F662B8142AA9DB7D5146810E504991A3D6DEAD5), keyId: 7527127265109344260 } }, client: { driver: { name: "mongo-java-driver|legacy", version: "3.12.14" }, os: { type: "Linux", name: "Linux", architecture: "amd64", version: "4.18.0-147.5.1.6.h1152.eulerosv2r9.x86_64" }, platform: "Java/Temurin/1.8.0_412-b08", mongos: { host: "host-192-168-63-158:8635", client: "10.17.10.33:38228", version: "4.0.3" }, username: "datax_user" }, configServerState: { opTime: { ts: Timestamp(1760387442, 1365), t: 6 } }, db: "zhcxkj_comprehensive_bi" } planSummary: COLLSCAN cursorid:4322697423883 keysExamined:0 docsExamined:2685900 numYields:23061 nreturned:101 reslen:81466 locks:{ Global: { acquireCount: { r: 23062 }, timeWaitingTicketMicros: { r: 418 } }, Database: { acquireCount: { r: 23062 } }, Collection: { acquireCount: { r: 23062 } } } protocol:op_msg 202737ms"
}
调整python同步,按照更新时间分批1小时拉一次,在每一批里面按照ID分割,同步