blob: efa32834eeabc916af5d7687257e93178244c730 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2885],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>f});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=r.createContext({}),d=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=d(e.components);return r.createElement(l.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),c=d(n),u=o,f=c["".concat(l,".").concat(u)]||c[u]||m[u]||a;return n?r.createElement(f,i(i({ref:t},p),{},{components:n})):r.createElement(f,i({ref:t},p))}));function f(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=n.length,i=new Array(a);i[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[c]="string"==typeof e?e:o,i[1]=s;for(var d=2;d<a;d++)i[d]=n[d];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}u.displayName="MDXCreateElement"},5008:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>f,frontMatter:()=>s,metadata:()=>d,toc:()=>c});var r=n(7462),o=n(3366),a=(n(7294),n(3905)),i=["components"],s={id:"insert-segment-to-db",title:"insert-segment-to-db tool"},l=void 0,d={unversionedId:"operations/insert-segment-to-db",id:"operations/insert-segment-to-db",title:"insert-segment-to-db tool",description:"\x3c!--",source:"@site/docs/latest/operations/insert-segment-to-db.md",sourceDirName:"operations",slug:"/operations/insert-segment-to-db",permalink:"/docs/latest/operations/insert-segment-to-db",draft:!1,tags:[],version:"current",frontMatter:{id:"insert-segment-to-db",title:"insert-segment-to-db tool"},sidebar:"docs",previous:{title:"reset-cluster tool",permalink:"/docs/latest/operations/reset-cluster"},next:{title:"pull-deps tool",permalink:"/docs/latest/operations/pull-deps"}},p={},c=[],m={toc:c},u="wrapper";function f(e){var t=e.components,n=(0,o.Z)(e,i);return(0,a.kt)(u,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"In older versions of Apache Druid, ",(0,a.kt)("inlineCode",{parentName:"p"},"insert-segment-to-db")," was a tool that could scan deep storage and\ninsert data from there into Druid metadata storage. It was intended to be used to update the segment table in the\nmetadata storage after manually migrating segments from one place to another, or even to recover lost metadata storage\nby telling it where the segments are stored."),(0,a.kt)("p",null,"In Druid 0.14.x and earlier, Druid wrote segment metadata to two places: the metadata store's ",(0,a.kt)("inlineCode",{parentName:"p"},"druid_segments")," table, and\n",(0,a.kt)("inlineCode",{parentName:"p"},"descriptor.json")," files in deep storage. This practice was stopped in Druid 0.15.0 as part of\n",(0,a.kt)("a",{parentName:"p",href:"https://github.com/apache/druid/issues/6849"},"consolidated metadata management"),", for the following reasons:"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"If any segments are manually dropped or re-enabled by cluster operators, this information is not reflected in\ndeep storage. Restoring metadata from deep storage would undo any such drops or re-enables."),(0,a.kt)("li",{parentName:"ol"},"Ingestion methods that allocate segments optimistically (such as native Kafka or Kinesis stream ingestion, or native\nbatch ingestion in 'append' mode) can write segments to deep storage that are not meant to actually be used by the\nDruid cluster. There is no way, while purely looking at deep storage, to differentiate the segments that made it into\nthe metadata store originally (and therefore ",(0,a.kt)("em",{parentName:"li"},"should")," be used) from the segments that did not (and therefore\n",(0,a.kt)("em",{parentName:"li"},"should not")," be used)."),(0,a.kt)("li",{parentName:"ol"},"Nothing in Druid other than the ",(0,a.kt)("inlineCode",{parentName:"li"},"insert-segment-to-db")," tool read the ",(0,a.kt)("inlineCode",{parentName:"li"},"descriptor.json")," files.")),(0,a.kt)("p",null,"After this change, Druid stopped writing ",(0,a.kt)("inlineCode",{parentName:"p"},"descriptor.json")," files to deep storage, and now only writes segment metadata\nto the metadata store. This meant the ",(0,a.kt)("inlineCode",{parentName:"p"},"insert-segment-to-db")," tool is no longer useful, so it was removed in Druid 0.15.0."),(0,a.kt)("p",null,"It is highly recommended that you take regular backups of your metadata store, since it is difficult to recover Druid\nclusters properly without it."))}f.isMDXComponent=!0}}]);